Atton Posted April 14, 2014 Share Posted April 14, 2014 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 Link to comment
Karuzo Posted April 14, 2014 Share Posted April 14, 2014 viewtopic.php?f=148&t=38203 Just scroll down where the db functions start Link to comment
Atton Posted April 18, 2014 Author Share Posted April 18, 2014 https://forum.multitheftauto.com/viewtopic.php?f=148&t=38203Just scroll down where the db functions start The tutorial is a tat big foggy. Link to comment
.:HyPeX:. Posted April 18, 2014 Share Posted April 18, 2014 https://forum.multitheftauto.com/viewtopic.php?f=148&t=38203Just 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. Link to comment
Atton Posted April 18, 2014 Author Share Posted April 18, 2014 https://forum.multitheftauto.com/viewtopic.php?f=148&t=38203Just 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. Link to comment
Saml1er Posted April 18, 2014 Share Posted April 18, 2014 Well you must know at least basics about sql to understand tutorial so check this out: http://www.w3schools.com/sql/sql_select.asp NOTE: Just don't use that ";" sign in mta. Link to comment
tosfera Posted April 18, 2014 Share Posted April 18, 2014 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. Link to comment
Atton Posted April 18, 2014 Author Share Posted April 18, 2014 Pretty much all I am looking for is a an example of how to write to an sql file. Or more information on how to use the sql functions. Link to comment
Noki Posted April 18, 2014 Share Posted April 18, 2014 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. Link to comment
.:HyPeX:. Posted April 18, 2014 Share Posted April 18, 2014 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? Link to comment
Noki Posted April 18, 2014 Share Posted April 18, 2014 The database file is server-sided. Link to comment
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