Jump to content

[HELP]Database


spoty

Recommended Posts

hi there

i wanne make a database for save driftpoints

like

best drift last drift and total drift

but i realy dont know how to make a database an how to link it to my drift script

please can someone explain me how to do this?

Link to comment
You could use SQLite/MySQL to store the drift points.

Functions:

executeSQLQuery -- SQLite only. 

Or:

MySQL & SQLite:

dbExec 
dbQuery 
dbPoll 

okay thnx

and how can i use it exactly?

to make it save in .lua or .xml?

Link to comment

XML is another thing, which can also be used to save the drift points.

Few SQLite examples:

Create table:

executeSQLQuery ( "CREATE TABLE IF NOT EXISTS drift_points ( accountName TEXT, points INT )" ) 

Insert row to table:

executeSQLQuery ( "INSERT INTO drift_points ( accountName, points ) VALUES ( ?, ? )", "Castillo", 500 ) 

Update row:

executeSQLQuery ( "UPDATE drift_points SET points = ? WHERE accountName = ?", 600, "Castillo" ) 

Link to comment
XML is another thing, which can also be used to save the drift points.

SQLite example to create a table:

executeSQLQuery ( "CREATE TABLE IF NOT EXISTS drift_points ( accountName TEXT, points INT )" ) 

okay i gues lua is easy way for it?

but i have this error now

[2014-05-10 20:32:39] Starting drift 
[2014-05-10 20:32:39] ERROR: Couldn't parse config Driftdatabase.lua in resource drift 
[2014-05-10 20:32:39] Failed to start resource item Driftdatabase.lua in drift 
[2014-05-10 20:32:39] start: Resource 'drift' start was requested (Failed to start resource item Driftdatabase.lua which is required) 
  
 

Link to comment
Oh well, if you want to use a own database file, then you must use the dbExec, dbQuery and dbPoll functions.

Check the wiki links for each, they all got examples.

okay i will wiki it :) and thnx for your help :) your a legit man for me :D

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