Looping
#2

pawn Code:
CMD:results(playerid,params[])
{
    mysql_query("SELECT * FROM `table`");
    mysql_store_resul();
    if(mysql_num_rows())
    {
        new msg[512];
        while(mysql_retrieve_row())
        {
            new tmp[24],name[24],Float:health,id;
            mysql_fetch_field_row(name,"name");
            mysql_fetch_field_row(tmp,"health"); health = floatstr(tmp);
            mysql_fetch_field_row(tmp,"id"); id = strval(tmp);
            format(msg,sizeof(msg),"%s%s - %d - %02f\n",msg,name,id,health);
        }
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"SQL Results",msg,"Close","");
    }
    else ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"SQL Results","No results found","Close","");
    return 1;
}
Reply


Messages In This Thread
Looping - by ihatetn931 - 31.03.2015, 13:48
Re: Looping - by xXShadowXx - 31.03.2015, 13:54
AW: Looping - by Kaliber - 31.03.2015, 13:54
Re: Looping - by ihatetn931 - 31.03.2015, 14:14

Forum Jump:


Users browsing this thread: 1 Guest(s)