Jump to content

Problem sorting using ORDER


kramster

Recommended Posts

Hi all,

 

I have a strange problem.

 

I am using the MySQL query

SELECT * FROM crh_log WHERE logdetix=$detix ORDER BY logix ASC

 

I have this exact query in two scripts, each gives a different result.

 

logix is the primary key to the table.

 

There are two rows that satisfy this query. One script returns the rows on ascending order of logix, the other is the reverse.

 

I've tried ORDER BY different variables and in one script it never makes a difference - it's as if MySQL is ignoring the ORDER by clause.

 

The MySQL code in the code snippets in attached file are identical. The only difference is that logix is displayed in the able in one script and not in the other.

 

 

 

Link to comment
Share on other sites

a) you didn't post any code. when posting code in the forum, please use the forum's


bbcode tags (the edit form's <> button).

 

b) you would also need to show us the raw data values in your table (showing the table definition would help too) and what the actual incorrect output is that you are getting from your code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.