SQL Sorting Categories
Posted: 24 June 2004 02:13 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  33
Joined  05-24-2004

{exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE parent_id = ‘2’"}
<li>{cat_name}<br>
{/exp:query}

I’m using this code to only show category items that only belong to a specific parent, but it doesn’t list the categories alphabetically, instead it does it by cat_id.  Is there anyway to sort it alphabetically?

Profile
 
 
Posted: 24 June 2004 02:36 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

SQL:  SELECT cat_name, cat_id FROM exp_categories WHERE parent_id = ‘2’ ORDER BY cat_name;

 Signature 
Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60724 Total Logged-in Users: 15
Total Topics: 73180 Total Anonymous Users: 10
Total Replies: 394670 Total Guests: 472
Total Posts: 467850    
Members ( View Memberlist )
Newest Members:  JitsunROPasterfredpwsAnita VJMaxthehuskybearRodrigo Tejerophan maopsydocsreagan