![]() |
SORT - ORDER BY , more than one ?
Is it possible in a query to sort by more than one value ?
I wanted to edit the sort by order options in the forumdisplay so that when I sort by user name it will sort by username but also then sort them into the date of last post. Is this possible ? :rambo: |
ORDER BY username, dateline DESC
the priority is from left to right :) |
nice one Xenon, can you possibly help me further I am have problems doing what I want.
I wanted to make a link on the forum threads ( in the forumdisplay ) so that users can click on them and sort them in set order. Ie a link next to the thread starters name that when pressed sorts the posts in that thread but also sorts them in the order of lastpost. So the link I have tried is /forumdisplay.php?s=&forumid=$forumid&sortfield=pos tusername,%20lastpost&sortorder=asc It dont work, so I tried this /forumdisplay.php?s=&forumid=$forumid&sortfield=tes t&sortorder=asc then in forumdisplay found PHP Code:
PHP Code:
PHP Code:
PHP Code:
Parse error: parse error, unexpected ',', expecting ']' in C:\Network\Apache2\htdocs\request\forumdisplay.php (702) : eval()'d code on line 1 It dont seem to work even with the error there ? Can you point me in the direction as to what I need to change ? Thanks :) |
put
PHP Code:
PHP Code:
|
why dont you try forumdisplay.php?sortfield=username,lastpost&order =asc
then change in the query PHP Code:
|
@mr_e: it wouldn work because of this switch case:
PHP Code:
|
but then couldn't he eliminate the switch all i thought the switch did was switch it between different querys, so it'd perform one query instead of another...that's what i thought anyway
|
thanks once again it works fine, one problem I'm getting the following error at the top
Parse error: parse error, unexpected ',', expecting ']' in C:\Network\Apache2\htdocs\request\forumdisplay.php (705) : eval()'d code on line 1 Any ideas ? |
what's line 705 and probably a few lines before and after
|
line 705 is
PHP Code:
If i "//" out the eval the error disappears. |
All times are GMT. The time now is 12:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|