Usually I would have a table field called ID on auto increment. That way I could order using this field etc.
However I have no control over the structure of a table, and wondered how to get the results in reverse order to default.
I’m currently using
$q = mysql_query("SELECT * FROM ServerChat LIMIT 15");
However like I said there is no field I can order on, so is there a way to tell mysql to reverse the order it gets the results? I.e last row to first row instead of the default.
MySQL supports ordering by ordinal column position:
But IIRC this usage of
ORDER BYis deprecated in the SQL standard. Don’t be surprised if some RDBMS vendors discontinue support for it (eventually).In general, it’s better to know your table structure.