enum pInfo
{
Username[25],
Password[50],
PlayerIP[19],
Score[9]
}
new PlayerInfo[MAX_PLAYERS][pInfo];
stock SaveUser(playerid)
{
new Query[400]; format(Query, sizeof(Query), "UPDATE `names` (Username, Password, PlayerIP, Score) VALUES('%s', '%s', '%s', 's')", GetName(playerid), PlayerInfo[playerid][Password], GetIp(playerid), PlayerInfo[playerid][Score]);
mysql_query(Query);
print(Query);
}
[12:55:35] [MySQL] Error (0): Failed to exeute query. 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 '(Username, Password, PlayerIP, Score) VALUES('Georgelopez1', '', '255.255.255.25' at line 1. [12:55:35] UPDATE `names` (Username, Password, PlayerIP, Score) VALUES('Georgelopez1', '', '255.255.255.255', 's') [12:55:35] [part] Georgelopez1 has left the server (0:1) |
format(Query, sizeof(Query), "UPDATE `names` SET (Username, Password, PlayerIP, Score) VALUES('%s', '%s', '%s', '%d')", GetName(playerid), PlayerInfo[playerid][Password], GetIp(playerid), PlayerInfo[playerid][Score]);
[Sun May 1 15:57:40 2011] Error (0): Failed to exeute query. 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 '(Username, Password, PlayerIP, Score) VALUES('Georgelopez1', '', '255.255.255.25' at line 1. |
[15:57:40] [MySQL] Error (0): Failed to exeute query. 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 '(Username, Password, PlayerIP, Score) VALUES('Georgelopez1', '', '255.255.255.25' at line 1. [15:57:40] UPDATE `names` SET (Username, Password, PlayerIP, Score) VALUES('Georgelopez1', '', '255.255.255.255', '1') |
stock SaveUser(playerid)
{
new Query[400];
format(Query, sizeof(Query), "INSERT INTO `names` WHERE `Score` = %d",
GetPlayerScore(playerid));
mysql_query(Query);
print(Query);
}
[09:01:43] [MySQL] Error (0): Failed to exeute query. 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 'WHERE `Score` = 10' at line 1. [09:01:43] INSERT INTO `names` WHERE `Score` = 10 [09:01:43] [part] Georgelopez1 has left the server (0:1) |
stock SaveUser(playerid)
{
new Query[400];
format(Query, sizeof(Query), "UPDATE `names` SET `Username` = '%s', `Password` = '%s', `PlayerIP` = '%s', `Score` = '%d'", GetName(playerid), PlayerInfo[playerid][Password], GetIp(playerid), PlayerInfo[playerid][Score]);
mysql_query(Query);
print(Query);
}