mysql error
#1

Код:
[17:07:42] errorid: 2014 | error: Commands out of sync; you can't run this command now | resultid: -1 | extraid: -1 | callback: NULL | query: SELECT `aLevel` FROM `accs` WHERE `pName` = 'Unknown123'
pawn Код:
stock getPlayerAdminLevel(playerid)
{
    new string[82], playername[24], PlayerAdminLevel[2];
    GetPlayerName(playerid, playername, sizeof(playername));

    format(string, sizeof(string), "SELECT `aLevel` FROM `accs` WHERE `pName` = '%s'", playername);
    mysql_query(string);
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_get_field("AdminLevel", PlayerAdminLevel);
    }
    mysql_free_result();
    return strval(PlayerAdminLevel);
}
why do i get that error in my log?
Reply
#2

Try this

pawn Код:
stock getPlayerAdminLevel(playerid)
{
    new string[82], playername[24], PlayerAdminLevel;
    GetPlayerName(playerid, playername, sizeof(playername));

    format(string, sizeof(string), "SELECT `aLevel` FROM `accs` WHERE `pName` = '%s'", playername);
    mysql_query(string);
    mysql_store_result();
    if(mysql_retrieve_row())
    {
        PlayerAdminLevel = mysql_fetch_int();
    }
    mysql_free_result();
    return PlayerAdminLevel;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)