if(rows > 0)
{
cache_get_field_content(0, "password", PlayerInfo[playerid][pPass]);
PlayerInfo[playerid][pKills] = cache_get_field_content_int(0, "kills");
PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0, "deaths");
PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "cash");
PlayerInfo[playerid][pKicks] = cache_get_field_content_int(0, "kicks");
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "admin");
PlayerInfo[playerid][pBans] = cache_get_field_content_int(0, "bans");
PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "skin");
new plrIP[16];
PlayerInfo[playerid][pIP] = GetPlayerIp(playerid, plrIP, sizeof(plrIP));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login...",""RED"Welcome Back ! We Miss You here !.\n"WHITE"Please Type You password to get back you rights","Login","Quit");
}
Check if(rows).
It's oblivious, open your eyes, You are loading the data with number row 0 and checking if rows > 0 ? How could that be even possible? |
[09:38:53] [WARNING] cache_get_row_count - no active cache
[09:38:53] [WARNING] CMySQLHandle::DeleteSavedResult - invalid result id ('0')
[09:38:55] [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 'SET `deaths` = '0' SET `skin` = '0' SET `cash` = '0' SET `admin` = '0' SET `kick' at line 1
OnPlayerDisconnect :
format(querylist, sizeof(querylist), "UPDATE `accounts` SET `kills` = '%d', `deaths` = '%d', `skin` = '%d', `cash` = '%d',`admin` = '%d', `kicks` = '%d', `bans` = '%d' WHERE `name` = '%s'", PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], GetPlayerSkin(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKicks], PlayerInfo[playerid][pBans], GetName(playerid));
OnDialogReponse:
format(querylist, sizeof(querylist), "INSERT INTO `accounts`(`name`, `ip`, `password`, `admin`, `skin`, `kills`, `deaths`, `cash`, `kicks`, `Bans`) VALUES('%s', '%s', '%s', '0', '0', '0', '0', '4000', '0', '0')", GetName(playerid), ip, inputtext);
new query[100], Cache:result;
format(query, 128, "SELECT * FROM `accounts` WHERE `name` = '%s'", GetName(playerid));
result = mysql_query(MySQL, query);
new rows = cache_get_row_count();
cache_delete(result);
if(rows)
{
// Is Exists
else
{
// Is not
}
cache_get_field_content(0, "password", PlayerInfo[playerid][pPass]);
PlayerInfo[playerid][pKills] = cache_get_field_content_int(0, "kills");
PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0, "deaths");
PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "cash");
PlayerInfo[playerid][pKicks] = cache_get_field_content_int(0, "kicks");
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "admin");
PlayerInfo[playerid][pBans] = cache_get_field_content_int(0, "bans");
PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0, "skin");