07.09.2010, 22:02
Try using this to see how many rows it thinks it should have.
and see if that reports the right number of results.
Код:
stock LoadGasstation() { MySQLCheck(); new idx;new data[256]; mysql_query("SELECT * FROM gasstation"); mysql_store_result(); if(mysql_num_rows() > 0) { printf("There are %d results",mysql_num_rows()); while(mysql_fetch_row(data)) { GasInfo[idx][tID] = idx; mysql_fetch_field("tGas",data);GasInfo[idx][tBenzin] = strval(data); mysql_fetch_field("tPosX",data);GasInfo[idx][tPosX] = floatstr(data); mysql_fetch_field("tPosY",data);GasInfo[idx][tPosY] = floatstr(data); mysql_fetch_field("tPosZ",data);GasInfo[idx][tPosZ] = floatstr(data); printf("ID: %d, Gas: %d, PosX: %f, PosY: %f, PosZ: %f",GasInfo[idx][tID],Gas[idx][tGas],GasInfo[idx][tPosX],GasInfo[idx][tPosY],GasInfo[idx][tPosZ]); idx++; } } mysql_free_result(); return 1; }