Biggest fail to a GetPlayerName function!
#2

pawn Код:
stock GetPlayerNameFromSQLid(SQLid)
{
    new query[53], pname[24]; // You don't need 256 cells...
    format(query, sizeof(query), "SELECT `username` FROM `accounts` WHERE `SQLid` = '%d'", SQLid);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_field("username", pname);
    mysql_free_result();
    return pname;
}
Something similar, I've never really needed to retrieve only 1 value from a MySQL query in PAWN, so I use an asterisk.
Reply


Messages In This Thread
Biggest fail to a GetPlayerName function! - by Antonio [G-RP] - 25.06.2010, 01:56
Re: Biggest fail to a GetPlayerName function! - by Calgon - 25.06.2010, 02:29
Re: Biggest fail to a GetPlayerName function! - by Antonio [G-RP] - 25.06.2010, 02:45
Re: Biggest fail to a GetPlayerName function! - by Calgon - 25.06.2010, 03:38
Re: Biggest fail to a GetPlayerName function! - by Antonio [G-RP] - 25.06.2010, 03:56

Forum Jump:


Users browsing this thread: 3 Guest(s)