Mysql ERROR - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql ERROR (
/showthread.php?tid=325542)
Mysql ERROR -
Renks554 - 13.03.2012
Errors at debug :
Код:
[19:46:06] CMySQLHandler::Query(SELECT id FROM kasutajad WHERE LOWER(kasutaja) = LOWER('Renn477') LIMIT 1) - Successfully executed.
[19:46:06] >> mysql_num_rows( Connection handle: 1 )
[19:46:06] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
[19:46:06] >> mysql_fetch_row_format( Connection handle: 1 )
[19:46:06] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
This happens when i save player data..
Код:
public OnPUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(LoggedIn[playerid] == true)
{
MySQLCheckConnection();
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new query[1024];
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
format(query, sizeof(query), "UPDATE kasutajad SET raha=%d, skin=%d, kills=%d, deaths=%d, admin=%d, lukus=%d WHERE kasutaja = %s",PlayerInfo[playerid][pCash], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pLukus], playername);
mysql_query(query);
}
}
return 1;
}
I have correctly connected GM to MYSQL.. Login works fine, but saving not.
Re: Mysql ERROR -
Lee_Percox - 13.03.2012
The debugs you have given are nothing to do with the code you have shown. The debug is calling NumRows and FetchRow functions, where as in your Query code you gave your doing none of them. Also it's a select statement in the log and your using an UPDATE there. You need to find the actual code the errors are in relation too.