24.07.2015, 15:38
Hello and thank you for putting some time aside to assist me with my problem.
I'll get right to the point, I was making a register/login system using MySQL, heck, I was not even making a new one, I was using the one I had on one of my old scripts (which worked back then) and I modified it a bit.
Well, basically, what happens is whenever a player registers and I insert all the columns into a table in my database, I receive an error and nothing is changed with the database.
Here's the code where I get my error.
And here's my public, which obviously I forwarded.
Ok, and now to the error, the error I get is
[OnAccountRegister] - (error #1054) Unknown column '456456' in 'field list'
"456456" is the password I input in the register dialog. I tried swapping Username and Password to see what happens and then it says the same just instead of 456456 it says the Username, what am I doing wrong? Is this happening because the code is outdated?
I'll get right to the point, I was making a register/login system using MySQL, heck, I was not even making a new one, I was using the one I had on one of my old scripts (which worked back then) and I modified it a bit.
Well, basically, what happens is whenever a player registers and I insert all the columns into a table in my database, I receive an error and nothing is changed with the database.
Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`Password`, `Username`, `AdminLevel`, `Helper`, `Money`, `Level`) VALUES (`%s`, `%s`, '0', '0', '1000', '1')", inputtext, pName[playerid]); mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
Код:
public OnAccountRegister(playerid) { printf("New account registered. ID: %d", pInfo[playerid][ID]); pInfo[playerid][ID] = cache_insert_id(mysql); return 1; }
Ok, and now to the error, the error I get is
[OnAccountRegister] - (error #1054) Unknown column '456456' in 'field list'
"456456" is the password I input in the register dialog. I tried swapping Username and Password to see what happens and then it says the same just instead of 456456 it says the Username, what am I doing wrong? Is this happening because the code is outdated?