[Help] MySQL
#1

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

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

I'm using G-Stylez's MySQL plugin.
Reply
#4

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

Yes..

pawn Код:
char..
Reply
#6

Could you post the stock function of the code?
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)