Mann56 Posted June 14, 2015 Share Posted June 14, 2015 Hey there guys, I have a little syntax error with Sqlite : Here's my sql code : Server side error script : addEvent("deleteTheGroup",true) addEventHandler("deleteTheGroup",root, function (thePlayer,groupByName) local rankq = getElementData(client,"rank") if rankq == "owner" then local check = dbPoll(dbQuery(connect, "SELECT * FROM groups WHERE column1 = ?",tostring(groupByName)), -1) if type(check) == "table" and #check == 0 or not check then dbExec(connect, "DELETE FROM groups VALUES (?)",tostring(groupByName)) end outputChatBox("Group System : Successfully deleted the group!",client,255,255,0) else outputChatBox("You are not the owner!!",client,255,0,0) end end) Thanks.... Link to comment
Baseplate Posted June 14, 2015 Share Posted June 14, 2015 dbExec(connect, "DELETE FROM groups WHERE column1=?",tostring(groupByName)) "VALUES" is used in INSERT syntax, use WHERE for conditions. 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