Converting into newer SQL
#1

So Ive got some old code I wanna convert into new SQL version but how do I do that? Im not really good with SQL or such.

This is for testing purposes. The goal is to achieve top players.

pawn Код:
CMD:test(playerid,params[])
{
    mysql_query("SELECT `Name`, `Score` FROM `players` ORDER BY `Score` DESC LIMIT 10");
    mysql_store_result();
    new szPrepTD[460], iIterator = 1, iScore, szName[MAX_PLAYER_NAME], szUnload[64];
    while(mysql_fetch_row_format(szUnload))
    {
        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++;
    }
    mysql_free_result();
    return true;
}
1. Yes Im using BlueG's SQL plugin
2. Yes Im aware that some stuff changed
3. Yes im aware a bit bit noobish with SQL

pawn Код:
error 035: argument type mismatch (argument 1)
 error 017: undefined symbol "mysql_store_result"
 error 017: undefined symbol "mysql_fetch_row_format"
 error 017: undefined symbol "mysql_free_result"

The goal is to get top 10 Score's from players database
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)