Jump to content

delete from internal.db


Recommended Posts

Hello, in trying to delete some records from  internal.db using sqlite db browser, but I got error.


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 by botshara
Link to post

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,
    connection = dbConnect("sqlite", "database.db")
    dbExec(connection, "DELETE FROM tableName WHERE dataName = ?", dataName)


Edited by Pembo
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...