Hi,
I'm trying to find a way to order the information I get from the DB. The items are links, and the DB structure is:
Code: Select all
link_name varchar(255)
link_url varchar(255)
link_desc varchar(255)
link_cat varchar(255)
Now the name, url and desc are unique to each link. But the cat is the category that they are in. There are about 5 or 6 different ones. What I want to do is to use a query to get all of the links, ie.
Code: Select all
$sql = 'SELECT *
FROM links';
$result = mysql_query($sql);
This works fine. What I want to do after this is get say, all the ones in the category 'PHP', and output them, via a loop, and then do this for all of the other categories. Is this possible, or do I have to use several different queries, ie.
Code: Select all
$sql = 'SELECT *
FROM links
WHERE link_cat=PHP';
Thanks for any help you can give me.
Sphen001