SQLite code
#1

This code is not working for me and i don't know why.

Код:
public SavePlayerHouse(houseid)
{
		new Query[384];

      	format(Query, sizeof(Query), "UPDATE HOUSES SET NAME = %s, SET FOR_SELL = &d, SELL_PRICE = %d  WHERE ID = %d ", HouseInfo[houseid][hName], HouseInfo[houseid][hSellable], HouseInfo[houseid][hSell], houseid);
 		db_query(Database, Query);

		format(Query, sizeof(Query), "UPDATE HOUSES SET RENT_PRICE = %d, HOUSE_LEVEL = %d, X = %f WHERE `ID` = %d ", HouseInfo[houseid][hRent], HouseInfo[houseid][hLevel], HouseInfo[houseid][hExitX], houseid);
 		db_query(Database, Query);
 		
 		format(Query, sizeof(Query), "UPDATE HOUSES SET Y = %f, Z = %f, STATUS = %d WHERE ID = %d ", HouseInfo[houseid][hExitY], HouseInfo[houseid][hExitZ], HouseInfo[houseid][hLocked], houseid);
 		db_query(Database, Query);
	  	
	  	
	  	
		return true;
}
Other stuff with houses like loading from the database is working!!
Reply
#2

Like I said on your previous thread, debugging is very helpful.

Your mistake is:

pawn Код:
SET NAME = %s, SET FOR_SELL = &d
which must be:
pawn Код:
SET NAME = '%s', FOR_SELL = %d
Be careful with your typing mistakes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)