![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
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 |
|
|
|
|
|
#2 |
|
Professional Programmer
|
|
|
|
|
|
|
#3 |
|
Programmer
|
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 |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
Yea, that was my first guess. That you used varchar not int....
Wow, what a waste of a post. This was useless.
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|