10.10.2010, 09:26
I got error when player update stats.
It success just last query.
Function updateplayer.
Where is wrong ?
It success just last query.
Код:
[16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET ) - An error has occured. (Error ID: 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 '' at line 1) [16:19:00] >> mysql_query( Connection handle: 1 ) [16:19:00] CMySQLHandler::Query(UPDATE `players` SET `Dead`='0' WHERE id='1') - Successfully executed.
pawn Код:
public MySQLUpdatePlayerInt(query[], sqlplayerid, sqlvalname[], sqlupdateint) // by Luk0r
{
MySQLUpdateBuild(query, sqlplayerid);
new updval[64];
format(updval, sizeof(updval), "%s=%d", sqlvalname, sqlupdateint);
strcat(query, updval, MAX_STRING);
return 1;
}
public MySQLUpdateBuild(query[], sqlplayerid) // by Luk0r
{
new querylen = strlen(query);
//new querymax = sizeof(query);
new querymax = MAX_STRING;
if (querylen < 1) format(query, querymax, "UPDATE players SET ");
else if (querymax-querylen < 50)
{
// query is too large, send this one and reset
new whereclause[32];
format(whereclause, sizeof(whereclause), " WHERE id=%d", sqlplayerid);
strcat(query, whereclause, querymax);
format(query, querymax, "UPDATE players SET ");
mysql_query(query);
}
else if (strfind(query, "=", true) != -1) strcat(query, ",", MAX_STRING);
return 1;
}
pawn Код:
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Money", PlayerInfo[playerid][pCash]);