[PXG]Blue Posted December 19, 2015 Share Posted December 19, 2015 Hello, i'm trying to make my server use MySQL instead of MTA's system, but i'm experiencing a problem, when i try to save the account data it doesnt get saved in the database and the mysql_free_result just says "result expected, got nil" Here is my Working code: result = mysql_query(handler, "INSERT INTO test (Name) VALUES ( 'meh' )") mysql_free_result ( result ) And this is one doesnt work: result = mysql_query(handler, "INSERT INTO players (Name, Serial, IP, Last_login, drift_score, drift_best, playtime_m,playtime_h, money, posx, posy, posz, int, dim) VALUES ( 'beh', 'behewahh', 'adgagd', '244sdfa', '0', '0', '0', '0', '0', '0', '0', '0','0','0' )") mysql_free_result ( result ) Any ideas? Greetings! Link to comment
Noki Posted December 20, 2015 Share Posted December 20, 2015 First off, I would recommend using the in-built db functions. According to the wiki, this would retrieve a result. However, you're trying to insert data so maybe you aren't supposed to get a return from that. I'm also pretty sure you don't need to free an insert query. Also, you're looking at the structure tab of phpMyAdmin. The browse tab, if the table isn't empty, should look something like this. Link to comment
MIKI785 Posted December 21, 2015 Share Posted December 21, 2015 Also in SQL queries its better to put any names of fields/tables within ` characters as some names are actual variables in MySQL. 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