flowz Posted August 6, 2014 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. [DEV]Universal Roleplay v1.0 BETA Release Date : Date not set. Website : http://www.universalroleplay.co Contact Email : [email protected] --------------------------------------------------------------------------------
joaosilva099 Posted August 6, 2014 Posted August 6, 2014 https://wiki.multitheftauto.com/wiki/Ser ... _functions http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
flowz Posted August 8, 2014 Author Posted August 8, 2014 I want to learn how to connect the scripts to MYSQL [DEV]Universal Roleplay v1.0 BETA Release Date : Date not set. Website : http://www.universalroleplay.co Contact Email : [email protected] --------------------------------------------------------------------------------
Anubhav Posted August 8, 2014 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 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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