SA-MP Forums Archive
Save Garege update mysql... - 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: Save Garege update mysql... (/showthread.php?tid=490528)



Save Garege update mysql... - Scrillex - 26.01.2014

Hello dear forum members..

I'm trying to update mysql to r34 from very very old one back in 2000.. So basically I have a question if this will work in my case of saving garage:


pawn Код:
stock SaveGarages()
{
    mysql_tquery(sql_handle, "SELECT * FROM Garages", "SaveGaragesData", "");
}
Here is the stock:

pawn Код:
forward SaveGaragesData(busid);
public SaveGaragesData(busid)
{
    new query[1024];
    format(query, sizeof(query), "UPDATE Garages SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,EnterAngle=%f,ExitAngle=%f WHERE GarageID=%d",
    Garages[busid][EnterX],
    Garages[busid][EnterY],
    Garages[busid][EnterZ],
    Garages[busid][ExitX],
    Garages[busid][ExitY],
    Garages[busid][ExitZ],
    Garages[busid][EnterAngle],
    Garages[busid][ExitAngle],
    busid);
    mysql_tquery(query);
    format(query, sizeof(query), "UPDATE Garages SET Owned=%d,Owner='%s',Price=%d,Interior=%d,Dynamic=%d,Open=%d WHERE GarageID=%d",
    Garages[busid][Owned],
    Garages[busid][Owner],
    Garages[busid][Price],
    Garages[busid][ExitInterior],
    Garages[busid][Dynamic],
    Garages[busid][Locked],
    busid);
    mysql_tquery(query);
}
Thank you for your time...

With best regards Scrillex.


Re: Save Garege update mysql... - Excelize - 27.01.2014

Hmm, from what I see it should. Most likely will be just very slow.


Re: Save Garege update mysql... - Scottas - 27.01.2014

No, it wont work. First of all, you haven't specified any parameters for callback in your query, but your callback uses 'busid'. Second: why do you select all elements from table and don't use any of selected data at all?