Jump to content

Sql


Atton

Recommended Posts

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

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

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