PHP/SQL Order by adding colums? =\ |
![]() ![]() |
PHP/SQL Order by adding colums? =\ |
Jan 1 2008, 07:02 PM
Post
#1
|
|
|
Member ![]() ![]() Posts: 51 OS: XP |
I want to arrange the info by adding 3 tables together. I've tried: $honor1 = $row['honorPoints']+$row['honorToday']+$row['honorYesterday']; $result = mysql_query("SELECT * FROM `characters` ORDER BY '$honor1' DESC LIMIT 3,47"); but it didn't work Thanks =]. --Linden |
|
|
Jan 4 2008, 05:33 AM
Post
#2
|
|
|
Member ![]() ![]() Posts: 46 From: Land of 10k lakes OS: windows XP Pro |
I'm not a PHP/MySQL expert but If "honorPoints","honorToday", and"honorYesterday" are separate tables with their own fields then you would need to use some "INNER JOIN" statements. If they are fields within the "characters" table then you could try something like this:
CODE $result = mysql_query("SELECT * FROM `characters` ORDER BY honorPoints DESC, honorToday DESC, honorYesterday DESC LIMIT 3,47");
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
4 / 375 | 11th January 2006 - 11:31 PM leniko started - last by leniko |
|||||
![]() |
0 / 288 | 18th August 2006 - 11:31 PM roy313 started - last by roy313 |
|||||
![]() |
5 / 398 | 3rd January 2008 - 02:19 PM Linden started - last by Metallica |
|||||
![]() |
1 / 177 | 17th April 2008 - 06:59 AM eengert started - last by eengert |
|||||
|
Time is now: 2nd December 2008 - 06:48 PM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |