Getting name from SQL, returns inputtext?!
#6

Use old mysql style xd

pawn Код:
stock GetSQLName(playersqlid)
{
    new Cache:result, string[128];
    format(string, sizeof(string), "SELECT `PlayerName` FROM `accounts` WHERE `id` = %d LIMIT 1", playersqlid);
    result = mysql_query(dbHandle, string);

    string = "N/A"; // if id doesnt exist
    if(cache_num_rows())
        cache_get_row(0, 0, string, dbHandle, MAX_PLAYER_NAME);

    cache_delete(result);
    return string;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)