Sign in to follow this  
botshara

delete from internal.db

Recommended Posts

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 by botshara

Share this post


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

 

Edited by Pembo

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.