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 17266 Jun 4, 2008, 7:48 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 17018 Jun 4, 2008, 8:07 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 16962 Jun 4, 2008, 11:37 PM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 16871 Jun 4, 2008, 11:57 PM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
EZFrag 16923 Jun 5, 2008, 12:23 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 16944 Jun 5, 2008, 1:13 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 16967 Jun 5, 2008, 2:34 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 16965 Jun 5, 2008, 2:39 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
dan 16883 Jun 5, 2008, 8:39 PM
Thread Re: [dan] MySQL Query ORDER BY giving weird results
Wychwood 16880 Jun 6, 2008, 2:27 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
SandraR 16848 Jun 9, 2008, 11:13 AM
Post Re: [SandraR] MySQL Query ORDER BY giving weird results
Wychwood 16823 Jun 10, 2008, 2:26 AM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Wychwood 16883 Jun 4, 2008, 11:10 AM