Page 1 of 1
[Solved]SQL statement question
Posted: Thu Feb 26, 2004 3:05 pm
by John Cartwright
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 )
Posted: Thu Feb 26, 2004 3:14 pm
by Mactek
try this:
$sql = "SELECT * FROM customercare WHERE (catagory = 'Shipping') ORDER BY `subheader`, `id` ASC";
Posted: Thu Feb 26, 2004 3:48 pm
by John Cartwright
thank ya!

Posted: Thu Feb 26, 2004 4:01 pm
by John Cartwright
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
Posted: Thu Feb 26, 2004 5:57 pm
by John Cartwright
up