botshara Posted April 7, 2017 Posted April 7, 2017 (edited) Hello, in trying to delete some records from internal.db using sqlite db browser, but I got error. SQL DELETE FROM accounts, userdata USING accounts INNER JOIN userdata on (accounts.id = userdata.userid) WHERE accounts.name='somename' Error: Error: near ",": syntax error What is wrong ? Edited April 7, 2017 by botshara
Pembo Posted April 8, 2017 Posted April 8, 2017 (edited) When using SQL in MTA you must use it within the MTA predefined functions: dbConnect() --establish the connection to database dbExec() --execute a database query with no result dbQuery() --database query with result An example of dbExec: addEventHandler("onResourceStart", resourceRoot, function() connection = dbConnect("sqlite", "database.db") dbExec(connection, "DELETE FROM tableName WHERE dataName = ?", dataName) end ) Edited April 8, 2017 by Pembo
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