flowz Posted August 6, 2014 Share Posted August 6, 2014 I made my server side MySQL script to connect to my MySQL Database but now how can I create MySQL Scripts such as account system connected to MySQL etc etc. Link to comment
joaosilva099 Posted August 6, 2014 Share Posted August 6, 2014 https://wiki.multitheftauto.com/wiki/Ser ... _functions Link to comment
flowz Posted August 8, 2014 Author Share Posted August 8, 2014 I want to learn how to connect the scripts to MYSQL Link to comment
Anubhav Posted August 8, 2014 Share Posted August 8, 2014 local connection = dbConnect("mysql","see_wiki") dbExec(connection, "CREATE TABLE IF NOT EXISTS tableName(column1,blablabla)") -- to create a table if it doesn't exist dbExec(connection, "INSERT INTO tableName VALUES(?,?,?)", "what", "hi", "bye") -- To insert a value into a TABLE. NOTE VALUS(?,?,?) should have question marks depending on columns. If columns are two there will be 2 question markers. and then it must be inserted after a comma. local query = dbQuery(connection,"SELECT * FROM tableName") -- Selects everything from the tableName! local poll = dbPoll(query,-1) -- Gets the result until it doesn't come answer = poll[1] -- The result is this. local query2 = dbQuery(connection,"SELECT column1 FROM tableName") -- selects column1 from a table name! local poll = dbPoll(query,-1) -- told before answer = poll[1] -- told before too 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