Hugos Posted September 9, 2019 Share Posted September 9, 2019 How do I add data from a database? (I use the plugin mta_mysql) Link to comment
Moderators IIYAMA Posted September 9, 2019 Moderators Share Posted September 9, 2019 (edited) 1 hour ago, Hugos said: How do I add data from a database? (I use the plugin mta_mysql) Add data to a database? INSERT INTO table_name (column1, column2 ) VALUES (?, ?) OR Get data from a database? SELECT * FROM table_name OR Import data to a database from another database. Edited September 9, 2019 by IIYAMA 1 Link to comment
Hugos Posted September 9, 2019 Author Share Posted September 9, 2019 (edited) 50 minutes ago, IIYAMA said: Add data to a database? INSERT INTO table_name (column1, column2 ) VALUES (?, ?) OR Get data from a database? SELECT * FROM table_name OR Import data to a database from another database. I get the player 's serial number at the moment, and if it 's not already recorded in the DB - I add. local username = getPlayerName(source) local serial = tostring(result_account.serial) local u_serial = getPlayerSerial(source) if (serial == u_serial) then --We check the serial number else if (serial == "") then --number will stop. Assign a new INSERT INTO accounts (, ) VALUES (?, ?) else end end How it is correct to make it? Edited September 9, 2019 by Hugos Link to comment
Moderators IIYAMA Posted September 9, 2019 Moderators Share Posted September 9, 2019 3 minutes ago, Hugos said: How it is correct to make it? Does that player already has an account? 1 Link to comment
Hugos Posted September 9, 2019 Author Share Posted September 9, 2019 (edited) 2 minutes ago, IIYAMA said: Does that player already has an account? Yes. It is already registered (nikneim in recorded in "username") Edited September 9, 2019 by Hugos Link to comment
Moderators IIYAMA Posted September 9, 2019 Moderators Share Posted September 9, 2019 5 minutes ago, Hugos said: Yes. It is already registered (nikneim in recorded in "username") Something like that: dbExec (db, "UPDATE accounts SET serial = ? WHERE username = ?", u_serial, username) 1 Link to comment
Hugos Posted September 9, 2019 Author Share Posted September 9, 2019 9 minutes ago, IIYAMA said: Something like that: dbExec (db, "UPDATE accounts SET serial = ? WHERE username = ?", u_serial, username) THANKS!!!! 1 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