Mysql ERROR
#1

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.
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)