27.06.2014, 12:39
The loop will stop if db_next_row returns 0. I haven't used do-while for that case, I'd do it as:
pawn Код:
new DBResult:Result, rows, hid, Field[21];
Result = db_query(BFU, "SELECT * FROM houses");
rows = db_num_rows(Result);
for (new i; i != rows; ++i)
{
db_get_field_assoc(Result, "id", Field, 9); hid = strval(Field);
if (hid >= sizeof (HouseInfo)) break; // if the "hid" is greater than the in-bounds index, stop the loop to prevent run time error 4
// rest of code.. db_get_field_assoc, create pickup and print the houseid..
db_next_row(Result);
}
db_free_result(Result);