12.01.2014, 12:16
hi, I have the following data on the table
id=0, kills=88
id=1, kills=90
id=2, kills=99
id=3, kills=110
id=4, kills=120
id=5, kills=3300
id=6, kills=789
id=7, kills=55
id=8, kills=33
I sort data
That's what happens
must be
it is fixable?
sorry my bad english=)
id=0, kills=88
id=1, kills=90
id=2, kills=99
id=3, kills=110
id=4, kills=120
id=5, kills=3300
id=6, kills=789
id=7, kills=55
id=8, kills=33
I sort data
PHP код:
new
db_count, kills [30], idnex, id [30];
sys_result = db_query (sys_db, "SELECT * FROM `players` ORDER BY `kills` DESC");
db_count = db_num_rows(sys_result);
for (new i ; i != db_count; ++i)
{
db_get_field_assoc (sys_result, "kills", sys_field, 20),
kills [idnex++] = strval(sys_field);
db_get_field_assoc (sys_result, "id", sys_field, 20),
id [idnex] = strval(sys_field);
db_next_row (sys_result);
}
db_free_result (sys_result);
for (new i ; i != 9; ++i) printf ("id %i, kills %i", id[i], kills[i]);
Quote:
[22:20:03] id 0, kills 99 [22:20:03] id 3, kills 90 [22:20:03] id 2, kills 88 [22:20:03] id 1, kills 789 [22:20:03] id 7, kills 55 [22:20:03] id 8, kills 3300 [22:20:03] id 6, kills 33 [22:20:03] id 9, kills 120 [22:20:03] id 5, kills 110 |
Quote:
[22:20:03] id 8, kills 3300 [22:20:03] id 1, kills 789 [22:20:03] id 9, kills 120 [22:20:03] id 5, kills 110 [22:20:03] id 0, kills 99 [22:20:03] id 3, kills 90 [22:20:03] id 2, kills 88 [22:20:03] id 7, kills 55 [22:20:03] id 6, kills 33 |
sorry my bad english=)