Mysql house system
#1

I am switching my houses to mysql from ini file storage thing.



I currently have 2 houses stored into the database and when the server restarts and loads the houses, only the first house loads not any others.

Please help me

here is my load feature:

Код:
stock LoadHouse()
{
new idx = 1;
		while(idx < MAX_HOUSE)
		{
		    new query[500];
    		mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `houses` WHERE `ID` = '%d'", idx);
    		mysql_query(MySQLCon, query);
		    HouseInfo[idx][hStatus] = cache_get_field_content_int(0, "Status");
		    HouseInfo[idx][hType] = cache_get_field_content_int(0, "Type");
		    HouseInfo[idx][hOwner]= cache_get_field_content(0, "Owner");
		    HouseInfo[idx][hX] = cache_get_field_content_float(0, "X");
		    HouseInfo[idx][hY] = cache_get_field_content_float(0, "Y");
		    HouseInfo[idx][hZ] = cache_get_field_content_float(0, "Z");
		    HouseInfo[idx][hMoney] = cache_get_field_content_int(0, "Money");
		    HouseInfo[idx][hLevel] = cache_get_field_content_int(0, "Level");
		    HouseInfo[idx][hPrice] = cache_get_field_content_int(0, "Price");
		    HouseInfo[idx][hXp] = cache_get_field_content_int(0, "XP");
		    HouseInfo[idx][hTrashX] = cache_get_field_content_float(0, "TrashX");
            HouseInfo[idx][hTrashY] = cache_get_field_content_float(0, "TrashY");
            HouseInfo[idx][hTrashZ] = cache_get_field_content_float(0, "TrashZ");
		    HouseInfo[idx][hRemovalYear] = cache_get_field_content_int(0, "RemovalYear");
		    HouseInfo[idx][hRemovalDay] = cache_get_field_content_int(0, "RemovalDay");
		    HouseInfo[idx][hLockStatus] = cache_get_field_content_int(0, "LockStatus");
			idx++;
	    }
	print("Houses loaded successfully.");
	return 1;
}
Reply


Messages In This Thread
Mysql house system - by jeffery30162 - 16.10.2014, 22:39
Re: Mysql house system - by Eth - 17.10.2014, 00:46
Re: Mysql house system - by jeffery30162 - 17.10.2014, 01:12
Re: Mysql house system - by austin070 - 17.10.2014, 01:37
Re: Mysql house system - by TakeiT - 17.10.2014, 02:08
Re: Mysql house system - by jeffery30162 - 17.10.2014, 03:55
Re: Mysql house system - by jeffery30162 - 19.10.2014, 21:25
Re: Mysql house system - by jeffery30162 - 21.10.2014, 15:54
Re: Mysql house system - by jeffery30162 - 25.10.2014, 21:21
Re: Mysql house system - by Neil. - 26.10.2014, 04:07

Forum Jump:


Users browsing this thread: 1 Guest(s)