MySQL VS INI?
#4

This is for BlueG's plugin, R7 and above:

pawn Code:
// Somewhere
new
    mysqlquery[80];

format(mysqlquery, sizeof(mysqlquery), "SELECT id, money FROM players WHERE name = '%s'", playername);
mysql_function_query(1, mysqlquery, true, "OnPlayerDataLoad", "d", playerid);

// Somewhere else
forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
    new
        rows,
        fields;

    cache_get_data(1, rows, fields);

    if(rows)
    {
        new temp[12];
        cache_get_row(0, 0, temp); PlayerInfo[playerid][pSQLID] = strval(temp);
        cache_get_row(0, 1, temp); PlayerInfo[playerid][pMoney] = strval(temp);
    }
    return;
}
Reply


Messages In This Thread
MySQL VS INI? - by Nathan_Taylor - 28.02.2013, 15:56
Re: MySQL VS INI? - by Vince - 28.02.2013, 16:14
Re: MySQL VS INI? - by Nathan_Taylor - 28.02.2013, 16:17
Re: MySQL VS INI? - by Vince - 28.02.2013, 18:01
Re: MySQL VS INI? - by Nathan_Taylor - 28.02.2013, 18:07
Re: MySQL VS INI? - by Nathan_Taylor - 28.02.2013, 19:06
Re: MySQL VS INI? - by Yves - 28.02.2013, 19:09
Re: MySQL VS INI? - by Djole1337 - 28.02.2013, 19:16
Re: MySQL VS INI? - by Nathan_Taylor - 28.02.2013, 19:19
Re: MySQL VS INI? - by Djole1337 - 28.02.2013, 19:24

Forum Jump:


Users browsing this thread: 2 Guest(s)