Hi
I would like offer the user a choice of displaying
search results. They should be able to select which column
to ORDER BY and in ascending or descending order.
$sort_order contain colums name
$sort_type contain desc or asc
How can I use these two arrays in the order by statement?
Option 1
I am getting this
error message: Error, query failed with this config
<?
$query ="select item number description
from test_table
where item = '$item'
order by ($sort_order) '$sort_type'";
?>
Option 2
The search results are displaying in ascending order.
But the "ORDER BY" statement is not working.
<?
$query ="select item number description
from test_table
where item = '$item'
order by '$sort_order' '$sort_type'";
?>