Jump to content

help selecting categories from directory


toolman

Recommended Posts

Hi there,

 

I have a business directory which has main categories and sub categories.

 

The main categories have a "level" of "1" and sub categories have a "level" of "2".

 

I have managed to select and display the main categories, but I cannot work out how to display the sub categories under each main category.

 

This is my PHP and MySQL:

 

$result = mysql_query("select * from pmd_categories where level = '1' ");
while($row = mysql_fetch_array($result))

{


echo "<a href='category/" . $row['friendly_url'] . "'>" . $row['title'] . "</a><br />";

}

 

Could someone help me out to display the sub categories under each main category?

 

Many thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.