SQLite results question
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
CMD:aka(playerid,params[])
{
    new ID,DBResult:Result,Query[70];
    if(sscanf(params,"u",ID)) SendClientMessage(playerid,-1,"USAGE: /aka [playerid]");
    else if(!IsPlayerConnected(ID)) SendClientMessage(playerid,-1,"ERROR: Player not connected.");
    else{
        format(Query,sizeof(Query),"SELECT * FROM `Accounts` WHERE `IP` = '%s'",IP[ID]);
        Result = db_query(DB,Query);
        if(!db_num_rows(Result)) SendClientMessage(playerid,-1,"ERROR: Results not found.");
        else{
            new Nick[MAX_PLAYER_NAME + 1];

            do
            {
                db_get_field_assoc(Result, "Name", Nick, sizeof(Nick)); // replace 'Name' to your real column name with player nicknames
                SendClientMessage(playerid, -1, Nick);
            }
            while(db_next_row(Result))
        }
        db_free_result(Result);
    }
    return 1;
}
thanks mate. +repped (sorry i can't give rep yet). thanks to you too Dwayne. +repped.
Reply


Messages In This Thread
SQLite results question - by xXShadowXx - 17.03.2013, 21:04
Re: SQLite results question - by Jefff - 17.03.2013, 21:25
Re: SQLite results question - by Konstantinos - 17.03.2013, 21:32
Re: SQLite results question - by xXShadowXx - 17.03.2013, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)