Jump to content

mysql problem


Master_Ali

Recommended Posts

hey their when i tried to connect to sqllight db it's not work that is my codes

i didn't know what is the wrong with it

db=dbConnect( "sqlite", "thedb.db" )

dbQuery(db,"CREATE TABLE IF NOT EXISTS house_system (id,price,owner,key,email,x,y,z,x1,y1,z1,int,dim,intenter,dimenter)")

debugscript 

=dbConnect is a nil value

Link to comment
4 hours ago, Master_Ali said:

hey their when i tried to connect to sqllight db it's not work that is my codes

i didn't know what is the wrong with it


db=dbConnect( "sqlite", "thedb.db" )

dbQuery(db,"CREATE TABLE IF NOT EXISTS house_system (id,price,owner,key,email,x,y,z,x1,y1,z1,int,dim,intenter,dimenter)")

debugscript 

=dbConnect is a nil value

hmm try this  code  i added  on my script and worked and be sure that u put thedb.db at script file.

addEventHandler ( "onResourceStart", resourceRoot,
    function ( resource )
        handler = dbConnect ( "sqlite", "thedb.db" )
        if ( handler ) then
            outputDebugString ( getResourceName ( resource ) ..": Successfully connected to SQLite database." )
            dbExec ( handler, "CREATE TABLE IF NOT EXISTS 'housing' ( id INTEGER PRIMARY KEY, houseName TEXT, houseOwner TEXT, housePrice bigint(255), houseOriginalPrice bigint(255), houseForSale TEXT, housePosition TEXT, houseInterior INT, houseInteriorState TEXT, buyDate TEXT, streamURL TEXT )" )
 

Link to comment
10 hours ago, DNL291 said:

Maybe there's an error with your database file.

 

13 hours ago, kerolous said:

hmm try this  code  i added  on my script and worked and be sure that u put thedb.db at script file.

addEventHandler ( "onResourceStart", resourceRoot,
    function ( resource )
        handler = dbConnect ( "sqlite", "thedb.db" )
        if ( handler ) then
            outputDebugString ( getResourceName ( resource ) ..": Successfully connected to SQLite database." )
            dbExec ( handler, "CREATE TABLE IF NOT EXISTS 'housing' ( id INTEGER PRIMARY KEY, houseName TEXT, houseOwner TEXT, housePrice bigint(255), houseOriginalPrice bigint(255), houseForSale TEXT, housePosition TEXT, houseInterior INT, houseInteriorState TEXT, buyDate TEXT, streamURL TEXT )" )
 

thx all but how i can create a database file i created it by new file and Chang his Format

like that

master.txt==>master.db

does that wrong?

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