help | again in mysql
#3

Here's a more optimized and more efficient way of retrieving the ID without being bothered which plugin he/she is using.

pawn Код:
stock GetPlayerNumberID (playerid)
{
    static
         s_string[ 72 ],
         s_return
    ;
    GetPlayerName( playerid, s_string, MAX_PLAYER_NAME );
    format( s_string, sizeof s_string, "SELECT `ID` FROM `Users` WHERE `Nick` = '%s'", s_query );
    mysql_query( s_string );
   
    mysql_store_result( );
    s_return = mysql_fetch_int( );
    mysql_free_result( );
   
    return s_return;
}
Reply


Messages In This Thread
help | again in mysql - by EviLpRo - 12.06.2011, 20:30
Re: help | again in mysql - by Scenario - 12.06.2011, 20:55
Re: help | again in mysql - by Cyanide - 12.06.2011, 21:04
Re: help | again in mysql - by Scenario - 12.06.2011, 21:10
Re: help | again in mysql - by Cyanide - 12.06.2011, 21:16
Re: help | again in mysql - by EviLpRo - 13.06.2011, 04:34

Forum Jump:


Users browsing this thread: 1 Guest(s)