24.09.2011, 16:50
There is something wrong with the
it does not get the latest id from database , and sets ID to: 0 , and this sets coords to Farmland lol.
is this fixable and how?
Func:
Code:
GetLastID();
is this fixable and how?
Func:
Code:
stock GetLastID() { new DBResult:qresult, count = 0, Value[128]; qresult = db_query(GPSDB, "SELECT * FROM `FGPSSystem` ORDER BY `ID` DESC LIMIT 1"); count = db_num_rows(qresult); for(new a=0;a<count;a++) { if(count <= MAX_LOCATIONS) { db_get_field_assoc(qresult, "ID", Value, 5); gValue[a] = Value[a]+1; db_next_row(qresult); } } db_free_result(qresult); return 1; }