ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 14th, 2005, 05:10 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Help with query

I am have an part of my game where you number can be anywhere from -99999999 (meaning you are a devil) to 99999999 (angel) and so on... i want to list the top 5 who has the most in each (positives and negatives)

the only way i can figure out how to do it (and it still doesnt work entirely) is:

<cfquery name="get_devils" datasource="userlogin">
SELECT alignment, user_ID, user_name from Battle
where alignment = 'devil'
ORDER by alignmentamount
</cfquery>
<cfoutput query="get_dev" maxrows="5">
#user_name#
</cfoutput>

except its not working.. it shows like (in order) -35, -4534, -254, -3, -642

when it should be 4534,-642, -254, -35, -3

what should i do to make this work right



how can i do this differently

Reply With Quote
  #2  
Old January 14th, 2005, 05:57 PM
glively glively is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 17 glively User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 51 sec
Reputation Power: 0
Is aligment defined as a numeric value in your DB?

Reply With Quote
  #3  
Old January 14th, 2005, 06:00 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,655 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 13 h 30 m 17 sec
Reputation Power: 53
If you do a cfdump of the query results, is it in the correct order? Is it possible your field is a string and not numeric, which would mess with the ordering?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Help with query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway