Save Garege update mysql...
#1

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

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)