17.02.2011, 16:36
Ok I'm having a similar problem now, except this time It is now the size of the Query array...
This works fine, a new file in the mysql database gets created:
And this doesn't work, while just one thing is added to the list of the format function, but no new files get created in the mysql database, all because of one extra thing.
Btw, can someone inform me about string sizes, because I read different things, like somewhere it said, the maximum could be 256, somewhere else it said it doesn't matter and the mysql gamemode from [leth4l] says Query[600], So I'm not sure what the maximum is.
This works fine, a new file in the mysql database gets created:
Код:
stock SaveHouses(playerid, PHouseID, PHouseOwner[], Float:PX, Float:PY, Float:PZ, Virtual, Interior, HCost, HInt, HAdress[]) { new aa = Virtual, ab = Interior, bb = HCost, bc = HInt, cc = HAdress[256], Query[1024]; //Query2[600]; format(Query, sizeof(Query), "INSERT INTO `houses` (houseID, HouseOwner, hX, hY, hZ, Virtualworld, Interior) VALUES (%d, '%s', %f, %f, %f, %d, %d)", PHouseID, PHouseOwner, PX, PY, PZ, aa, ab); mysql_query(Query); //mysql_query(Query2); mysql_free_result(); return 1; }
Код:
stock SaveHouses(playerid, PHouseID, PHouseOwner[], Float:PX, Float:PY, Float:PZ, Virtual, Interior, HCost, HInt, HAdress[]) { new aa = Virtual, ab = Interior, bb = HCost, bc = HInt, cc = HAdress[256], Query[1024]; //Query2[600]; format(Query, sizeof(Query), "INSERT INTO `houses` (houseID, HouseOwner, hX, hY, hZ, Virtualworld, Interior, Cost) VALUES (%d, '%s', %f, %f, %f, %d, %d, %d)", PHouseID, PHouseOwner, PX, PY, PZ, aa, ab, bb); mysql_query(Query); //mysql_query(Query2); mysql_free_result(); return 1; }