If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Order By ordering wrong

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-07-06, 12:41
jwman jwman is offline
Registered User
 
Join Date: Aug 2004
Posts: 82
Order By ordering wrong

Heres the problem when I order certain information from my database for example:

Number: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11

It would echo when called with PHP as:
1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9


I can see why it does this but is there a way so it will echo in a chronological order the PHP I am using is:

PHP Code:
$getnums = ("SELECT * FROM my_table WHERE var = '1' ORDER BY number ASC");
while (
$row mysql_fetch_array[$getnums]){
$numbersindb $row['number'];
echo 
$numbersindb
Reply With Quote
  #2 (permalink)  
Old 01-07-06, 12:56
jwman jwman is offline
Registered User
 
Join Date: Aug 2004
Posts: 82
opps, sorry...The table structure was varchar and needed to be INT to order numerically...how stupid >.<
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On