Gossamer Forum
Home : General : Databases and SQL :

MySQL Query ORDER BY giving weird results

Quote Reply
MySQL Query ORDER BY giving weird results
Hi there Smile,

I have the following table
Code:

ID | Name
1 |
2 |
3 |
4 |
5 |
6 | book
7 | testing
8 | PERL
9 | CSS Mastery
10 | Cellphones

When I do a SELECT ID,Name FROM table ORDER BY Name; using a CGI Script, I get the following result:

Code:
ID | Name
1 |
6 | book
2 |
7 | testing
3 |
8 | PERL
4 |
9 | CSS Mastery
5 |
10 | Cellphones

Now if I use SQL Monitor, The expected results are returned:

Code:

ID | Name
1 |
2 |
3 |
4 |
5 |
6 | book
10 | Cellphones
9 | CSS Mastery
8 | PERL
7 | testing

Is there something I am missing here?

Thanks Unsure


Sacrifice is not about what you lose,
it is about what you gain in the process.
Subject Author Views Date
Thread MySQL Query ORDER BY giving weird results EZFrag 25343 Jun 4, 2008, 7:48 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24965 Jun 4, 2008, 8:07 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 24918 Jun 4, 2008, 11:37 PM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24762 Jun 4, 2008, 11:57 PM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
EZFrag 24861 Jun 5, 2008, 12:23 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24912 Jun 5, 2008, 1:13 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 24920 Jun 5, 2008, 2:34 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24936 Jun 5, 2008, 2:39 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
dan 24858 Jun 5, 2008, 8:39 PM
Thread Re: [dan] MySQL Query ORDER BY giving weird results
Wychwood 24845 Jun 6, 2008, 2:27 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
SandraR 24811 Jun 9, 2008, 11:13 AM
Post Re: [SandraR] MySQL Query ORDER BY giving weird results
Wychwood 24713 Jun 10, 2008, 2:26 AM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Wychwood 24761 Jun 4, 2008, 11:10 AM