Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2005, 4:28 PM   #1
scorpiosage
Programmer
 
scorpiosage's Avatar
 
Join Date: Aug 2004
Location: Austin, Tx
Posts: 55
Rep Power: 5 scorpiosage is on a distinguished road
Send a message via AIM to scorpiosage Send a message via Yahoo to scorpiosage
Sorting order by

Here's a tricky question.
I have
[code]
$sql = "SELECT * FROM client ORDER by memid";
[\code]
This should order it by the memid in ascending order right? well, I run the script and I get
107659
119300
87611

Now, that isn't ordered at all. it appears that it is reading the numbers from the left and not the entire number itself?

Not sure what the deal is.
Is there a way that I can force it to do this correctly, without adding extra 000 to the beginning of the number to get it? The problem is that these are real numbers in a database that I can not change because it is information inputed by users that is exact information that they have from another website that I do not have access to. For proper record keeping of these id's they need to remain untouched, as they will also be inserted into URL get methods for later use.

Any help.
Thanks in advance
Mike
__________________
Here's my latest project still in the works, and I need to get rid of this "frame" situation for real. www.prideofaustin.com
scorpiosage is offline   Reply With Quote
Old Feb 15th, 2005, 4:48 PM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
ORDER BY memid ASC

for the record

http://dev.mysql.com/doc/mysql/en/select.html
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Feb 15th, 2005, 5:08 PM   #3
scorpiosage
Programmer
 
scorpiosage's Avatar
 
Join Date: Aug 2004
Location: Austin, Tx
Posts: 55
Rep Power: 5 scorpiosage is on a distinguished road
Send a message via AIM to scorpiosage Send a message via Yahoo to scorpiosage
here's the solution

Well, the problem wasn't ASC, DESC.
for those who have similar problems with things of this nature. When you are doing your database structure, make sure that you make an entry that is going to be all numbers "int" instead of what I did. Since, I really don't understand all the different attributes, I tend to just keep them all VARCHAR. Now we know that we need to use INT.
Hope that this helps someone.
Mike
__________________
Here's my latest project still in the works, and I need to get rid of this "frame" situation for real. www.prideofaustin.com
scorpiosage is offline   Reply With Quote
Old Feb 15th, 2005, 9:17 PM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Yea, that was my first guess. That you used varchar not int....

Wow, what a waste of a post. This was useless.
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC