Jump to content

SQL question


Cronoss

Recommended Posts

I don't know if this is the right topic for a question like this but I don't know where to ask 

 

I want to know what's the difference between saving the data in internal.db (simple script)

function guardarDinero()
	cuenta = getPlayerAccount(source)
	setAccountData(cuenta, "dinero", tostring (getPlayerMoney(source)))

end
addEventHandler("onPlayerQuit", getRootElement(), guardarDinero)

And creating a ".db" archive, using a script like this (script every command for the database): 

local db = dbConnect("sqlite", "test.db")

function addDATA(sourcePlayer)
	dbExec (db, "INSERT INTO info (id_player, id_vehicle, color) VALUES(1, 401, ?", color)
  -------etc

Because I've seen people telling other users that should learn about sql, and that kind of stuff

Link to comment
  • Moderators
2 hours ago, Cronoss said:

I don't know if this is the right topic for a question like this but I don't know where to ask 

 

I want to know what's the difference between saving the data in internal.db (simple script)

function guardarDinero()
	cuenta = getPlayerAccount(source)
	setAccountData(cuenta, "dinero", tostring (getPlayerMoney(source)))

end
addEventHandler("onPlayerQuit", getRootElement(), guardarDinero)

And creating a ".db" archive, using a script like this (script every command for the database): 

local db = dbConnect("sqlite", "test.db")

function addDATA(sourcePlayer)
	dbExec (db, "INSERT INTO info (id_player, id_vehicle, color) VALUES(1, 401, ?", color)
  -------etc

Because I've seen people telling other users that should learn about sql, and that kind of stuff

 

Account data is a database interface and manager for ONLY account-bounded-data.

 

dbConnect + all other db functions, allows you to create your own database interface and manager. This gives you a lot of freedom, but it also means that you have to write a lot yourself.

 

 

 

 

  • Thanks 1
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...