hello,

phpmyadmin have a feature that order the tables by the added in db order DESC how can i order the table to ASC

EDIT: I forget to say, i don't have a row that sets added time so i can't order by rows

Recommended Answers

All 2 Replies

MySQL only allows for sorting on values, may they be field values or function results or constants or whatever, but not on the order of entry into the db.
In a client program like phpMyAdmin you could list the data in reverse order, though, by having a routine like

for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) {
  mysql_data_seek($i);
  $row = mysql_fetch_row($result);
  display($row);
}

But the more natural and easier way would be to enhance the table by an auto_increment field on which you could sort DESC and ASC using the phpMyAdmin interface.

thx smantscheff

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.