![]() |
Sort order problem
I have a little game database, I am trying to sort the data (per a user click) by title, or by systme or by whatever the user specifies. Here's the code that I have, it's not sorting:
PHP Code:
|
TRY changing this line (which is i think line number 42)
PHP Code:
PHP Code:
Line numbers can be wrong. so, take care i think all you did is put the query at wrong place. just need to exchange it Suggestion don't order by the input from url. what if i changed the url manually and changed to Something_wrong. this will give error and your query won't execute try, using switch statement as PHP Code:
|
I took your suggestion, that's a better way of going about it. I also fixed the default view / sorting too. Thank you for the help.
|
glad to help you
|
Hmf, I have been trying to get this resolved but it doesn't seem to work... I have created a link for them to be sorted ASC which works, but DESC will not work.
Tried setting up another case and result array but it did not work. Any pointers? |
Using 2 different techniques (ASC & DESC) is not impossible, but its going to take a lot of tihinking
for example page.php?order=name&method=asc page.php?order=phone&method=asc page.php?order=postal&method=asc say, i have above 3 links.so, for sorting you already got it and ASC is the default. now, if you want to do desc too, then when you choose the order you also need to change the method to DESC for next time. PHP Code:
i know its not clear. but, i couldn't find an example to support it |
| All times are GMT. The time now is 05:15 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0