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 25008 Jun 4, 2008, 7:48 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24621 Jun 4, 2008, 8:07 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 24580 Jun 4, 2008, 11:37 PM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24426 Jun 4, 2008, 11:57 PM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
EZFrag 24521 Jun 5, 2008, 12:23 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24567 Jun 5, 2008, 1:13 AM
Thread Re: [Andy] MySQL Query ORDER BY giving weird results
EZFrag 24582 Jun 5, 2008, 2:34 AM
Thread Re: [EZFrag] MySQL Query ORDER BY giving weird results
Andy 24591 Jun 5, 2008, 2:39 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
dan 24511 Jun 5, 2008, 8:39 PM
Thread Re: [dan] MySQL Query ORDER BY giving weird results
Wychwood 24509 Jun 6, 2008, 2:27 AM
Thread Re: [Wychwood] MySQL Query ORDER BY giving weird results
SandraR 24470 Jun 9, 2008, 11:13 AM
Post Re: [SandraR] MySQL Query ORDER BY giving weird results
Wychwood 24379 Jun 10, 2008, 2:26 AM
Post Re: [EZFrag] MySQL Query ORDER BY giving weird results
Wychwood 24426 Jun 4, 2008, 11:10 AM