Jump to content

Recommended Posts

I am tired of searching online because everywhere it says use ORDER BY ..... ASC | DESC.

 

But that does not work for ordering data in alphabetical order. I don't understand how come that is working for so many people?

 

My query is:

"SELECT * FROM categories WHERE parentid = '$getid'";

 

I am listing categories on left side bar and there are more than 70 categories. I want them to appear in alphabetical order starting from A - Z.

 

I know there is some different syntax in sql query for ordering data alphabetically because i saw it once and it worked but i just forgot where i read it and now i am lost.

Your data probably contains white-space/non-printing characters (spaces, carriage-returns, nulls, line-feeds, ...) that is causing it be sorted out of order.

 

Where did your data originate and how did it get inserted into your table?

 

There are literally millions of php based web sites that use ORDER BY in queries that work. Had you stated or shown what results you are getting in your first post in this thread (where it belonged), you could have gotten an answer quicker, rather than playing around with what problem you actually are having.

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.