26.02.2010, 12:48
I made this to count how many houses i have, so i can make loop better.. First time the public works well, so it gives the right answer but if i run this public again it's answer is always zero..
Whats wrong here ?
Code:
public totalhouses() { new query[64], Field[64]; format(query, sizeof(query), "SELECT count(hsqlid) FROM `houses`"); mysql_query(query); mysql_store_result(); mysql_fetch_field_row(Field, "count(hsqlid)"); totalhouses = strval(Field); mysql_free_result(); format(query, sizeof(query), "Houses = %d",totalhouses); print(query); return totalhouses; }