Hiya, I'm trying to sort a database from what a user clicks on. So if they click on "sortbyname" it sorts it by name, and if they click on "sortbydate" it sorts the information by date.
This is what I have so far :
The link clicked on takes them to http://localhost/list.invoice.php?page=date
Then,
PHP Code:
<?php
echo $WFunctions->listInvoices($_GET['page']);
?>
This pulls what page equals, so for this example its "date"
PHP Code:
function listInvoices($page) {
Then this gets it.
PHP Code:
$query = mysql_query("SELECT * FROM invoice WHERE filename = '".$element."' ORDER BY $page");
And this trys to sort it.
The information is getting sent because I can use
PHP Code:
echo('$user_id');
And it prints out what page equals.
It doesn;t sort the data though
Really stuck here :/
__________________
CUrrent sites working on...
http://www.Crashdays.com/
http://www.nzfiles.com/
|