Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Thu Feb 26, 2004 3:05 pm
This is my current statement
Code: Select all
<?php
$sql = "SELECT * FROM customercare WHERE (catagory = 'Shipping') ORDER BY `subheader` ASC";
?>
How do I make it order by subheader AND then by ID ( or anything else )
Mactek
Forum Commoner
Posts: 28 Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston
Post
by Mactek » Thu Feb 26, 2004 3:14 pm
try this:
$sql = "SELECT * FROM customercare WHERE (catagory = 'Shipping') ORDER BY `subheader`, `id` ASC";
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Thu Feb 26, 2004 4:01 pm
Okay that worked perfect... but there is 1 more problem
I need them to sort by subheader... so my db looks like this
text --- subheader
blah ---- blah1
blah ---- blah1
blah ---- blah1
blah ---- blah2
blah ---- blah3
But now I need to order the actual subheaders on my page :S :S... what is a good way to go about this. How can I choose the order of the subheaders without having to numberate them or something?
Help, ty