SA-MP Forums Archive
error 017: undefined symbol "mysql_free_result" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 017: undefined symbol "mysql_free_result" (/showthread.php?tid=569377)



error 017: undefined symbol "mysql_free_result" - Scrillex - 30.03.2015

Hello! Today I'm ugrading my mysql script but.... I need some help with this function... I can't figure out with hat BlueG's tutorial how to do it...


SCRIPT:
pawn Код:
format(szString, sizeof(szString), "[Referral] (New Account: %s (IP:%s)) has been referred by (Referred Account: %s (IP:%s))", GetPlayerNameEx(playerid), currentIP, PlayerInfo[playerid][pReferredBy], newresult);
            Log("logs/referral.log", szString);
            mysql_free_result(MainPipeline);
ERROR:
pawn Код:
error 017: undefined symbol "mysql_free_result"
So I have a question how to change it to whats needed... TO:

pawn Код:
new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        cache_get_row(0, 0, name); // Store the data from the name field into the name string.
        new temp[12]; // Create a temporary string to store the numeric values we will not retrieve.
        cache_get_row(0, 1, temp); // Store the string representation of the player's level in the temporary string.
        level[playerid] = strval(temp); // Store the numeric representation of the player's level in the right array.
        // The same comments go for the next 2 fields (kills and deaths).
        cache_get_row(0, 2, temp), kills[playerid] = strval(temp);
        cache_get_row(0, 3, temp), deaths[playerid] = strval(temp);
    }
    return 1;

With best regards Scrillex!


Re: error 017: undefined symbol "mysql_free_result" - Konstantinos - 30.03.2015

Simply remove it! mysql_free_result has been removed a long time ago.

Also use cache_get_row_int/float as they're much faster and easier to do it.


Re: error 017: undefined symbol "mysql_free_result" - Scrillex - 30.03.2015

Thank you for your answer Where to use it? Because I'm kind a new to mysql!


Re: error 017: undefined symbol "mysql_free_result" - Konstantinos - 30.03.2015

https://sampwiki.blast.hk/wiki/MySQL/R33#cache_get_row_int

So for example, this:
pawn Код:
cache_get_row(0, 2, temp), kills[playerid] = strval(temp);
becomes:
pawn Код:
kills[playerid] = cache_get_row_int(0, 2);



Re: error 017: undefined symbol "mysql_free_result" - Scrillex - 30.03.2015

Thanks again Konstantinos