24, July 2008

help with ordering DB values - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: help with ordering DB values
« previous next »
Pages: [1] Print

Author Topic: help with ordering DB values  (Read 578 times)
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« on: Aug 11, 2006, 08:18:41 PM »

for some reason when this panel parses it shows it in the wrong order, im using 3 test values to see how it orders it, 0, 91, and 100. it orders it as 91, 100, 0 when it should be 100, 91, 0...

Code:
<?php


$result dbquery("SELECT user_name, user_clanrank, user_cpts
FROM "
.$db_prefix."users 
ORDER BY user_cpts 
DESC LIMIT 0,5
"
);

echo "<table width='100%' cellpadding='0' cellspacing='1' border='0'>";

if (dbrows($result)!=0) {
while ($data=dbarray($result)) {
include BASEDIR."colors2.php";
echo "<tr>
<td class='small' align='left'><a style='color: $mm_color' href='"
.BASEDIR."profile.php?lookup=".$data['user_id']."'>
"
.$data['user_name']."</a></td>
<td class='small2' align='right'>"
.$data['user_cpts']."</td>
</tr>"
;
}
}
echo "</table>";

?>

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7974
40801 credits
Members referred : 3



« Reply #1 on: Aug 11, 2006, 08:21:28 PM »

The only way for this to happen, is if the user_cpts field is not an integer.....

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3634
Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: help with ordering DB values
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 24, 2008, 11:23:15 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.712
Total Topics: 7.376
Total Members: 3.706
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: FortuneBeach

35 Guests, 3 Users online :

12 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.