Welcome Guest ( Log In | Join )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide. Want to reply to a topic, start a new one, or remove the advertising? Join today (always free).
      
 
Reply to this topicStart new topic
PHP/SQL Order by adding colums? =\
Linden
post Jan 1 2008, 07:02 PM
Post #1


Member
**
Posts: 51
OS: XP



Now everything is how I want, I just need a little more help wink.gif

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 sad.gif. Any Ideas?

Thanks =].

--Linden
Go to the top of the page
 
+Quote Post
gunner12
post 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");
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   4 / 375 11th January 2006 - 11:31 PM
leniko started - last by leniko
No New Posts   0 / 288 18th August 2006 - 11:31 PM
roy313 started - last by roy313
No New Posts 5 / 398 3rd January 2008 - 02:19 PM
Linden started - last by Metallica
No New Posts   1 / 177 17th April 2008 - 06:59 AM
eengert started - last by eengert

RSS 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.