SQLite COUNT()
#4

Ok,i kind of sorted it out but now:

Код:
stock CreatePlayerHouse(playerid, sellprice, HouseLvl)
{
		new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
		new ID, Query[256];

       	format(Query, sizeof(Query), "SELECT COUNT * FROM `HOUSES`");
 		ID = 1 + db_query(Database, Query);
 		new string[128];
		format(string, sizeof (string), "ID = %i", ID);
		printf(string);
      	
      	format(Query, sizeof(Query), "INSERT INTO `HOUSES` ('ID') VALUES('%d')", ID);
 		db_query(Database, Query);

		------> format(Query, sizeof(Query), "UPDATE `HOUSES` SET NAME = 'Grad', FOR_SELL = '1', SELL_PRICE = '%d', RENTPRICE = '1000', HOUSE_LEVEL = '%d', X = '%f', Y = '%f', Z = '%f' WHERE `ID` = '%d' ", sellprice, HouseLvl, X, Y, Z, ID);
 		db_query(Database, Query);
      	
      	
       	SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: House has been Successfully created.");
       	//LoadPlayerHouse(ID);
		return true;
}
The problem is in the marked line,the ID code from the line above saves fine but the code under does not save the values.
Reply


Messages In This Thread
SQLite COUNT() - by Danijel. - 07.07.2013, 19:33
Re: SQLite COUNT() - by Jefff - 07.07.2013, 19:46
Re: SQLite COUNT() - by ReVo_ - 07.07.2013, 19:48
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:03
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:10
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:31
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:38
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:53
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:59
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)