Forums
This topic is locked
Sort by
Posted 28 Aug 2002 18:00:05
1
has voted
28 Aug 2002 18:00:05 Les Wainman posted:
I need to give users the choice of how they sort a table, either by date, title etc. I am using the built in PHP server model. <img src=../images/mxzone/forum/icon_smile.gif border=0 align=middle> Replies
Replied 11 Sep 2002 22:22:28
11 Sep 2002 22:22:28 Trey Wentz replied:
There is probobly a more glamorous way to do this but I am not familiar with php. You can however create 3 pages that look almost exactly the same except have the pages sort the data in on each page by the different orders you require. Then in the headline of the table to you could have each headin link to the appropriate page. This theroy should work an ANY of the sever models provided with MX.
HTH
JustTrey
HTH
JustTrey
Replied 12 Sep 2002 17:06:36
12 Sep 2002 17:06:36 Vince Baker replied:
you only need one page to do this, in the recordset you need to filter the query by a parameter from the URL. if your page is called index.asp then add a link on title (normally the column heading) that has "index.asp?Sortby=Title ASC" or link on Date heading of "index.asp?sortby=Date ASC".
your recordset should look something like this:
Select *
FROM TableName
ORDER BY 'varSortBy'
Add the param 'varSortby' with the default value being the initial sort when the user opens the page e.g. Date ASC and then the runtime value = Request.Querystring("sortby"
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
your recordset should look something like this:
Select *
FROM TableName
ORDER BY 'varSortBy'
Add the param 'varSortby' with the default value being the initial sort when the user opens the page e.g. Date ASC and then the runtime value = Request.Querystring("sortby"
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting