Assuming I have made this query:
$q = "SELECT c_frame + c_glass + c_materials + c_fees + c_commissions + c_other AS total_cost,
image_title, sold, price, b_sell_price, print_available, DATE_FORMAT(date_created, '%Y-%m-%d')
AS dc, DATE_FORMAT(date_added, '%Y-%m-%d') AS da, DATE_FORMAT(b_date_sold, '%Y-%m-%d') AS ds
FROM art WHERE ($date_col_name >= '$begin_date') AND ($date_col_name <= '$end_date') ORDER BY $order_by"
$r = @mysqli_query ($dbc, $q);
If I save the value of $r so it is available after re-sending the page from the server, can I then resort the query differently than the original sort rather than making the same query again?
I have column headings in my table that look like this:
<th><a href="overview.php?sort=image_title">Title</a></th> (so the data can be resorted)
However the original query (above) has selected data according to a date range. I would like to keep the exact results from the original query and sort it according to the column specified in the <th></th>.
I hope I am being clear.