Converting into newer SQL
#2

pawn Код:
CMD:test(playerid, params[])
{
       mysql_tquery(dbHandle, query, "SELECT `Name`, `Score` FROM `players` ORDER BY `Score` DESC LIMIT 10", "onTestCallback", "i", playerid);
       return 1;
}

forward onTestCallback(playerid);
public onTestCallback(playerid)
{
    new szPrepTD[460], iIterator = 0, iScore, szName[MAX_PLAYER_NAME], szUnload[64], rows, data;
cache_get_data(rows, data, dbHandle);

if(rows)
{
    while(iIterator < rows)
    {
        sscanf(szUnload, "p<|>sd", szName, iScore);
        if(strlen(szPrepTD) == 0) format(szPrepTD, sizeof(szPrepTD), "#%d - %s (%d score)\n", iIterator, szName, iScore);
        format(szPrepTD, sizeof(szPrepTD), "%s#%d - %s (%d score)\n", szPrepTD, iIterator, szName, iScore);
        iIterator++;
    }
}

else SendClientMessage(playerid, -1, "No query results.");
return 1;
Reply


Messages In This Thread
Converting into newer SQL - by TwinkiDaBoss - 06.08.2015, 19:48
Re: Converting into newer SQL - by Abagail - 06.08.2015, 20:10
Re: Converting into newer SQL - by TwinkiDaBoss - 07.08.2015, 14:35
Re: Converting into newer SQL - by TwinkiDaBoss - 07.08.2015, 20:12

Forum Jump:


Users browsing this thread: 1 Guest(s)