13.10.2013, 10:31
Hi all
I've been having some problems with loading mysql data into enums. I'm not sure why, I searched the interwebs, but I couldn't find anything that solved my problem. This is the code I use:
I load the houses with the code above. The enum, is as follows:
Now here's the problem, only the ownername is loaded, as you can see in this print debug:
I'm sure it's the sscanf code though, since the mysql debug is as follows:
Any help would be greatly appreciated, thanks in advance!
I've been having some problems with loading mysql data into enums. I'm not sure why, I searched the interwebs, but I couldn't find anything that solved my problem. This is the code I use:
pawn Code:
new Query[1000];
HouseCount = 0;
format(Query,1000,"SELECT * FROM houses WHERE Created = '1'");
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row(Query))
{
sscanf(Query,"e<p<|>s[32]ddddfffdds[128]s[128]d>",HInfo[HouseCount]);
HouseCount++;
}
pawn Code:
enum HouseInfo{
Owner[MPN], //MPN is 32
InteriorID,
Locked,
Owned,
Price,
Float:XOut,
Float:YOut,
Float:ZOut,
Created,
HouseNumber,
StreetName[128],
PhoneNumber[128],
HouseID
}
new HInfo[MAX_HOUSES][HouseInfo];
Code:
[12:11:26] ******* LOADING HOUSE 1 ************ [12:11:26] Owner: No-One [12:11:26] Locked: 0 [12:11:26] Owned: 0 [12:11:26] Price:0 [12:11:26] XOut: 0.000000 [12:11:26] YOut: 0.000000 [12:11:26] ZOut: 0.000000 [12:11:26] Created: 0 [12:11:26] HouseNumber: 1 [12:11:26] *************************************
Code:
No-One|1|1|0|95000|2067.7|-1628.86|14.5166|1|56|Test.Street|030125187|1