MySQL and ORDER BY

software development

#1

Hi All,

I have an SQL query which I’m running against a MySQL db with an ORDER BY clause.

When I access the php page running on a local copy of my website, everything works perfectly. But when I upload it to the DH site, the ORDER BY does’nt take effect.

Any ideas why the order by is being ignored? It just returns the same order (appears to be by id/unique key) every time :confused:

Cheers,
Slopey


#2

Are you also running MySQL locally, or is it connecting to DH’s MySQL server?

Perhaps if you having a local MySQL, the DH database doesn’t have an index for the table?

:cool: Perl / MySQL / HTML+CSS


#3

Having an index shouldn’t have any impact on the order by clause. All the index does is speed up the process