errors.
#1

Hi there, I have a problem with my login/register system. I can enter on the serve, register(if the account doesn't exists) and then If I exit I made a function to save everything for the player but in mysql_log I have an error..

Код:
[04:38:09] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET `Username` = %e, `Password` = %e, `posX` = %f, `posY` = %f, `posZ` = %f, `posA` = %f WHERE `ID` = %i"
[04:38:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `Username` = , `Password` = , `posX` = 50.", callback: "(null)", format: "(null)"
[04:38:09] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[04:38:09] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `Password` = , `posX` = 50.0, `posY` = 50.0, `posZ` = 50.0, `posA` = 0.0 WHERE ' at line 1
[04:38:09] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
This is the function

Код:
    mysql_format(MySQL, query, sizeof(query), "UPDATE `accounts` SET `Username` = %e, `Password` = %e, `posX` = %f, `posY` = %f, `posZ` = %f, `posA` = %f WHERE `ID` = %d", playername, Player[playerid][Password], pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]);
    mysql_tquery(MySQL, query, "", "");
So.. what's wrong ? :-s I tried to repair it myself for some time..
Reply
#2

If you work with strings you have to use ' before and after the string.
Look here I corrected this:
PHP код:
mysql_format(MyQL,query,sizeof query,"UPDATE `accounts` SET `Username`='%e',`Password`='%e',`posX`=%f,`posY`=%f,`posZ =%f,`posA`=%f WHERE `ID`=%d",playernamePlayer[playerid][Password], pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); 
Reply
#3

Nope.. not working, It bugges all the system + database..
Reply
#4

Can you send us the currect mysql.log with the current code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)