Hi HartleySan
Many thanks for your advice
The url is generated by the script in a function called absolute url and it appears in the IE7 address bar perfectly.
Tried changing all the urls to ones without spaces (ansd all in lowercase) as that seemed a good idea
It did not work
I have previously tried running sections of the code on their own, such as:
CODE SECTION 1:
<tr>
<td align="left"><b>Edit</b></td>
<td align="left"><b>Delete</b></td>
<td align="left"><b><a href="view_users.php?sort=ln">Last Name</a></b></td>
<td align="left"><b><a href="view_users.php?sort=fn">First Name</a></b></td>
<td align="left"><b><a href="view_users.php?sort=rd">Date Registered</a></b></td>
</tr>
Which is the code to generate the ?sort and it works perfectly
CODE SECTION 2:
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'rd';
switch ($sort) {
case 'ln':
$order_by = 'last_name ASC';
break;
case 'fn':
$order_by = 'first_name ASC';
break;
case 'rd':
$order_by = 'registration_date ASC';
break;
default:
$order_by = 'registration_date ASC';
$sort = 'rd';
break;
}
which is the section to rearrange the sort works if i try to echo $order_by just to test it.
But when they are combined with the section
$q = "SELECT last_name, first_name, DATE_FORMAT(registration_date, '%M %d, %Y') AS dr, user_id FROM users ORDER BY $order_by LIMIT $start, $display";
$r = @mysqli_query ($dbc, $q);
Which should make the lists reorder
It stops working and the program stops recognising the url appendage (?sort=)
Trevor