SA-MP Forums Archive
[Help] 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] MySQL (/showthread.php?tid=189363)



[Help] MySQL - Maxips2 - 11.11.2010

I'm having a problem with saving (updating) ints/floats.
Theres no problem with saving strings.

Anyway, I'm using the query builder..

pawn Код:
public MySQLSaveHouse(houseid)
{
    MySQLCheckConnection();
    format(query, MAX_STRING, "UPDATE houses SET ");
    MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_X", HouseInfo[houseid][hEntrancex], MYSQL_ID_HOUSE);
    MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_Y", HouseInfo[houseid][hEntrancey], MYSQL_ID_HOUSE);
    MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_Z", HouseInfo[houseid][hEntrancez], MYSQL_ID_HOUSE);
    MySQLUpdateInt(query, HouseInfo[houseid][hSQLID], "Price", HouseInfo[houseid][hPrice], MYSQL_ID_HOUSE);
    MySQLUpdateStr(query, HouseInfo[houseid][hSQLID], "Description", HouseInfo[houseid][hDescription], MYSQL_ID_HOUSE);
    MySQLUpdateFinish(query, HouseInfo[houseid][hSQLID], MYSQL_ID_HOUSE);
    return 1;
}
Its not the whole code, but its just a part of it, (float, int and string saving).
Any ideas?


Re: [Help] MySQL - Scenario - 11.11.2010

I have no idea what MySQL plugin you are using, but I can tell you that if you used "G-Stylez", it would be a whole hell of a lot easier and probably faster...


Re: [Help] MySQL - Maxips2 - 11.11.2010

I'm using G-Stylez's MySQL plugin.


Re: [Help] MySQL - Scenario - 11.11.2010

pawn Код:
MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_X", HouseInfo[houseid][hEntrancex], MYSQL_ID_HOUSE);
    MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_Y", HouseInfo[houseid][hEntrancey], MYSQL_ID_HOUSE);
    MySQLUpdateFlo(query, HouseInfo[houseid][hSQLID], "Entrance_Z", HouseInfo[houseid][hEntrancez], MYSQL_ID_HOUSE);
    MySQLUpdateInt(query, HouseInfo[houseid][hSQLID], "Price", HouseInfo[houseid][hPrice], MYSQL_ID_HOUSE);
    MySQLUpdateStr(query, HouseInfo[houseid][hSQLID], "Description", HouseInfo[houseid][hDescription], MYSQL_ID_HOUSE);
    MySQLUpdateFinish(query, HouseInfo[houseid][hSQLID], MYSQL_ID_HOUSE);
Would those be custom functions then?


Re: [Help] MySQL - Maxips2 - 11.11.2010

Yes..

pawn Код:
char..



Re: [Help] MySQL - Scenario - 11.11.2010

Could you post the stock function of the code?


Re: [Help] MySQL - Maxips2 - 11.11.2010

Well, I don't think it matters because I used them for other savings such as saving player statics.
Also, I found out that there are only a few variables which doesn't save, I'll try to fix it later, probably something that i just did wrong with MySQL fields or wrong texts.. Thanks anyway

Thread can be closed.