Master_Ali Posted April 26, 2017 Posted April 26, 2017 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
kerolous Posted April 26, 2017 Posted April 26, 2017 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 )" )
DNL291 Posted April 27, 2017 Posted April 27, 2017 Maybe there's an error with your database file. Please do not PM me with scripting related question nor support, use the forums instead.
Master_Ali Posted April 27, 2017 Author Posted April 27, 2017 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?
NeXuS™ Posted April 29, 2017 Posted April 29, 2017 A txt format wont be converted to db format with nothing. You can't convert a text file to a database, because they don't do the same. A txt file is for notes, a db file is for datas. Did I help you? NeXuS™#0001
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now