MySQL R7 problem
#1

Hey guys!

pawn Код:
new qstr[200];
format(qstr,200,"SELECT * FROM `players` WHERE `username`='%s';",plname);
mysql_function_query(g_Handle, qstr, true, "OnPlayerCheckAccount", "i", playerid);
^ I've got the code above but sometimes the variable isn't set correctly. Is the code wrong?

pawn Код:
forward OnPlayerCheckAccount(playerid);
public OnPlayerCheckAccount(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        gPlayerAccount[playerid] = 1;
        cache_get_row(0, 2, PlayerInfo[playerid][pKey], g_Handle);
    }
    else
    {
        gPlayerAccount[playerid] = 0;
    }
}
Please help me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)