how to invert mysql result? thanks and happy hollidays 🙂
$sql = "SELECT ... ... ... "; $retid = $db->db_query($sql); while ( $row = $db->fetchrows... ) { echo $result[...] // TODO: sort this result }
You can either use ORDER BY in your query, and set it to ASC or DESC depending on what you need, or load all of your rows into an array and then reverse the array.
it works, thanks
$sql .= "ORDER BY `id` DESC"; $retid = $db->db_query($sql);