Jump to content

Sql


Atton

Recommended Posts

Posted

I have been trying to work with sql however I have have really hit a brick wall.

In a nutshell I have no idea what these functions do that the terminology used to describe them is confusing.

executeSQLQuery

dbConnect -- Pretty sure this connects a db file.

dbExec

dbQuery

dbPoll

dbFree

Nikola Tesla is love Nikola Tesla is light.

Email: [email protected]

Posted
https://forum.multitheftauto.com/viewtopic.php?f=148&t=38203

Just scroll down where the db functions start :)

The tutorial is a tat big foggy.

Ineeded, dont ask for help if you're not willing to read.

I have read and I have looked however the functions are still confusing.

All I am looking to learn is how to read and write from sqllight nothing more than that.

Nikola Tesla is love Nikola Tesla is light.

Email: [email protected]

Posted
NOTE: Just don't use that ";" sign in mta.

Maybe you could explain him, and me, why? MTA is working with the semicolumns but also without. it has no single effect to the code and won't be unstable nor less powerfull. It is a matter of way to write your code. You can say it's part of the scripters coding standards. :)

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

Well, it consists of basically putting information in (dbExec), and getting information (dbQuery). Think of it like MTA function, there are ones that use 'get', and others that use 'set'. Getting and setting data is the same in SQL.

Firstly, you need to connect to a database. If you want to use SQLite, you just write 'local connection = dbConnect("database.db", "sqlite")'. Doing that connects to a local .db file, in which your data will be stored. That is now stored as connection. So, you would need to use executeSQLQuery or dbExec to create some tables.

executeSQLQuery("CREATE TABLE IF NOT EXISTS `data` blah blah....

Now, you insert some data using dbExec(connection, INSERT INTO blah blah.

Posted
Well, it consists of basically putting information in (dbExec), and getting information (dbQuery). Think of it like MTA function, there are ones that use 'get', and others that use 'set'. Getting and setting data is the same in SQL.

Firstly, you need to connect to a database. If you want to use SQLite, you just write 'local connection = dbConnect("database.db", "sqlite")'. Doing that connects to a local .db file, in which your data will be stored. That is now stored as connection. So, you would need to use executeSQLQuery or dbExec to create some tables.

executeSQLQuery("CREATE TABLE IF NOT EXISTS `data` blah blah....

Now, you insert some data using dbExec(connection, INSERT INTO blah blah.

The .db file will be saved inside the script or the server?

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

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