Jump to content

[HELP]SQL


Dimos7

Recommended Posts

function db_connect()
    connection = dbConnect("sqlite", ":/global.db")
	dbExec(connection, "CREATE TABLE IF NOT EXISTS vehicles(id int(11) , model int(3) DEFAULT '0',x decimal(10,6) DEFAULT '0.000000', y demical(10,6) DEFAULT '0.000000' , z demical(10,6) DEFAULT '0.000000', rotx demical(10,6) DEFAULT '0.000000', roty demical(10,6) DEFAULT '0.000000', rotz demical(10,6) DEFAULT '0.000000')")
end
addEventHandler("onResourceStart", resourceRoot, db_connect)

function db_query(callbackFunction, str)
    return dbQuery(callbackFunction, connection, str)
end

function db_exec(str)
   return dbExec(connection, str)
end

dbQuery expect db-connection argument 1 got nil

Edited by Dimos7
Link to comment

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