error 017: undefined symbol "mysql_free_result"
#1

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!
Reply
#2

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.
Reply
#3

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

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);
Reply
#5

Thanks again Konstantinos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)