Inverse PHP mysql_fetch_array
I get last 4 row from database, but I want order these 4 rows in inverse
mysql_query("SELECT * FROM `table` ORDER BY `id` DESC LIMIT 4");
How can I do this?
mysql_query("SELECT * FROM (SELECT * FROM table ORDER BY id DESC LIMIT 4) t ORDER BY id ASC");
i Think this should do
mysql_*t before ORDER ?
mysql_queryshould not be used in new applications. It's a deprecated interface that's being removed from future versions of PHP. A modern replacement like PDO is not hard to learn and is a lot easier to use correctly.