Simple. Posted June 10, 2015 Share Posted June 10, 2015 آلسلام عليكم ورحة الله وبركاته كيف حآلكم لآهنتم انا عندي مشكلة في جدول قآعدة آلبيانات سويت جدول , لكن لما يطلع ويكون معه الداتا "Banned" يطلع لي خطاء بآلديبوق يقول [02:59:34] ERROR: xAdminmsg\s.lua:17: Database query failed: no such column: CC4 193688D1DBA488EC8A309EE1A52E3 طبعاً هذآ سيريآلي , لكن مآدري وش فيه مو رآضي يضبط , وهذا الكود ! addEventHandler('onResourceStart',resourceRoot, function ( ) local CreateNewTable = executeSQLQuery("CREATE TABLE IF NOT EXISTS blcser (serial,ban)") if ( CreateNewTable ) then outputDebugString('Create [ Black List Table ] Table done .') end end ) addEventHandler('onPlayerQuit',root, function ( ) local blc = getElementData ( source, "Banned" ) if ( blc ) == Yes then outputDebugString('get data done.') local Results = executeSQLQuery("SELECT * FROM blcser WHERE serial=?",getPlayerSerial ( source ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO blcser (serial,ban) VALUES(?,?)", getPlayerSerial ( source ), blc ) else executeSQLQuery('UPDATE blcser SET ban =? WHERE serial =?',blc,getPlayerSerial ( source ) ) end end end ) Link to comment
The Killer Posted June 10, 2015 Share Posted June 10, 2015 addEventHandler ("onResourceStart", resourceRoot, function () local CreateNewTable = executeSQLQuery ("CREATE TABLE IF NOT EXISTS blcser (serial, ban)") if ( CreateNewTable ) then outputDebugString ("Create [ Black List Table ] Table done .") end end ) addEventHandler ("onPlayerQuit", root, function () local blc = getElementData ( source, "Banned" ) if ( blc ) == Yes then outputDebugString ("get data done.") local Results = executeSQLQuery ("SELECT * FROM blcser WHERE serial=?", tostring (getPlayerSerial (source)) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery( "INSERT INTO blcser (serial, ban) VALUES (?, ?)", tostring (getPlayerSerial (source)), tostring (blc)) else executeSQLQuery ("UPDATE blcser SET ban =? WHERE serial =?", tostring (blc), tostring (getPlayerSerial (source)) ) end end end ) Link to comment
Simple. Posted June 10, 2015 Author Share Posted June 10, 2015 (edited) متغير Yes? هذي آلقيمه حقت الداتا "Banned" -- The Killer يعطيكك آلعافيه لكن فيه مشكله لما يدخل ماترجع له الداتا addEventHandler ("onResourceStart", resourceRoot, function () local CreateNewTable = executeSQLQuery ("CREATE TABLE IF NOT EXISTS blcser (serial, ban)") if ( CreateNewTable ) then outputDebugString ("Create [ Black List Table ] Table done .") end end ) addEventHandler ("onPlayerQuit", root, function () local blc = getElementData ( source, "Banned" ) if ( blc ) == Yes then outputDebugString ("get data done.") local Results = executeSQLQuery ("SELECT * FROM blcser WHERE serial=?", tostring (getPlayerSerial (source)) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery( "INSERT INTO blcser (serial, ban) VALUES (?, ?)", tostring (getPlayerSerial (source)), tostring (blc)) else executeSQLQuery ("UPDATE blcser SET ban =? WHERE serial =?", tostring (blc), tostring (getPlayerSerial (source)) ) end end end ) addEventHandler('onPlayerJogin',root, function ( ) local Results = executeSQLQuery("SELECT * FROM blcser WHERE serial=?",tostring (getPlayerSerial ( source )) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end outputChatBox ("load Data Done.", source, 255,0,0 ) setElementData ( source,"Banned", Results[1]['ban'] ) end ) Edited June 10, 2015 by Guest Link to comment
ALw7sH Posted June 10, 2015 Share Posted June 10, 2015 اذا سويت setElementData(player,"Banned",Yes) ماكانت معرفه Yes و nil الالمنت داتا بتكون Edit: ومو متاكد لو ذا يأثر او لا بس انت وانت تصنع التيبل الكولمنز ماحددت اذا TEXT - INT etc.. Link to comment
Simple. Posted June 10, 2015 Author Share Posted June 10, 2015 آنحلت آلمشكله مآقصرتو كان فيه خطاء باسم الافنت Link to comment
The Killer Posted June 10, 2015 Share Posted June 10, 2015 متغير Yes? هذي آلقيمه حقت الداتا "Banned" -- The Killer يعطيكك آلعافيه لكن فيه مشكله الله يعافيك .. بس زي ما قال الوحش فوق setElementData (source, "Banned", Yes) كذا ما يصلح لأنها بتطلع لك فراغ الي هو nil فعشان كذا سو لها سترنق زي كذا setElementData (source, "Banned", "Yes") Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now