I need an example to convert MySQL R6 to MySQL R7.
#2

pawn Code:
loadVehicle(playerid) {
    format(query, sizeof query, "SELECT `id` FROM `vehicles` WHERE `owner` = '%s' AND `plate` = '15640'", pname);
    mysql_function_query(yourConnectionHandleHere, query, true, "OnVehicleLoad", "d", playerid);
}

forward OnVehicleLoad(playerid);
public OnVehicleLoad(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);

    if(!rows) return 0;

    new content[11];

    cache_get_row(0, 0, content, yourConnectionHandleHere);
    UserInfo[playerid][uVehKey1] = strval(content);
    SaveStats(playerid);

    new rand = random(sizeof(VehicleSpawns)), query[500];
    format(query, sizeof(query), "UPDATE `vehicles` SET `park_x` = '%f', `park_y` = '%f', `park_z` = '%f' WHERE `id` = '%d'", VehicleSpawns[rand][0], VehicleSpawns[rand][1], VehicleSpawns[rand][2], UserInfo[playerid][uVehKey1]);
    mysql_function_query(yourConnectionHandleHere, query, false, "", "");

    format(query, sizeof(query), "UPDATE `vehicles` SET `plate` = '*' WHERE `id` = '%d'", UserInfo[playerid][uVehKey1]);
    mysql_function_query(yourConnectionHandleHere, query, false, "", "");
    return 1;
}
Reply


Messages In This Thread
I need an example to convert MySQL R6 to MySQL R7. - by Guyl - 03.01.2013, 16:25
Re: I need an example to convert MySQL R6 to MySQL R7. - by ReneG - 03.01.2013, 19:12
Re: I need an example to convert MySQL R6 to MySQL R7. - by Guyl - 03.01.2013, 19:56
Re: I need an example to convert MySQL R6 to MySQL R7. - by ReneG - 03.01.2013, 20:29

Forum Jump:


Users browsing this thread: 2 Guest(s)