Passing data to the order by clause?
Posted: Wed Dec 18, 2002 3:36 am
You know the order by clause of the select statement? Is it possible to set up a way where you could click on a link and pass .php?Sortby=ColumName and then setup the select to order by Sortby. I've been messing with that, but couldn't get it to work.
The best I can come up with is just using the same code over and over in php files with differant names to sort the table by differant categories. I know there has to be a way to do it the other way :/
When I tried it the other way, I have it setup like this:
<a href="www.server.com/file.php?sortby=Date">
"select ............... from Table order by sortby desc");
Anyone have the solution?
The best I can come up with is just using the same code over and over in php files with differant names to sort the table by differant categories. I know there has to be a way to do it the other way :/
When I tried it the other way, I have it setup like this:
<a href="www.server.com/file.php?sortby=Date">
"select ............... from Table order by sortby desc");
Anyone have the solution?