Is there a default ORDER BY value?
I have a dynamic mysql query and part is ORDER BY
hardcoded into the query.
The problem is I don't know if every request will have ORDER BY
, and I don't know which columns will be available for ordering.
Is there a default that I can write so that I can use
if (empty($order)){$order = "default_value"}
$query = "select ...... ORDER BY $order"
+3
source to share