Jump to content

SQLite problems


rockleg

Recommended Posts

Posted

im having a problem with SQLite, i'm connecting to the database but the table is not created

local db = dbConnect('sqlite', 'accounts.db') 
dbQuery(db, 'CREATE TABLE IF NOT EXISTS accounts') 

Posted

You can check the wiki page of any function for the syntax and a basic example.

local qh = dbQuery('SELECT * FROM accounts') 
local results = dbPoll(qh, -1) 

-1 means that it will wait for the database to return the results. You can also use callbacks which is better because it doesn't freeze the server till the data is returned.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

am i using callbacks right?

local qh = dbQuery(callback, db, 'SELECT * FROM accounts') 
  
function callback(qh) 
 local results = dbPoll(qh, -1) 
end 

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...