Mr.Mostafa Posted November 9, 2018 Share Posted November 9, 2018 سلام عليكم عندي مشكلة بقاعدة بيانات انا ابي لو كتبت /nt وكلمة الكلمة يكون لها ايدي مخفي في قاعدة البيانات .. والايدي يكون الايدي الي عليه الدور ولو كتبت /st واي ايدي يجبلي الكلمة الي محفوظة في الايدي هادا executeSQLQuery( "CREATE TABLE IF NOT EXISTS testss ( id,text )" ) addCommandHandler("nt", function ( source,cmd,text ) if text then outputChatBox("* "..text.."",source,0,255,0,true) local checkSQL = executeSQLQuery ( "SELECT * FROM testss") local new = checkSQL.id or 0 local insert = executeSQLQuery( "INSERT INTO testss ( id, text ) VALUES( ? , ? )", new+1, text ) if insert then outputChatBox("done",source,255,0,0,true) end else outputChatBox("* insert text",source,255,0,0,true) end end ) addCommandHandler("st", function ( source,cmd,id ) if id then local Query = executeSQLQuery("SELECT * FROM testss WHERE id", id) outputChatBox("* result : "..Query.text.."",source,0,255,0,true) outputChatBox("* id : "..id.."",source,0,255,0,true) else outputChatBox("* insert text",source,255,0,0,true) end end ) 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