I cant find anything on this:
How do I create categories in PHP using a mysql database...For example:
I want to have about 12 top level categories and then I want to have some sub categories beneath each of those....
Are there are tutorials available for creating this?
Thanks
Comments
Photoshop Tutorials- Coming soon
Premium PHP Scripts- Coming soon
Haha i should really do some work so i can remove all the coming soon's
The Royal Ram
Photoshop Tutorials- Coming soon
Premium PHP Scripts- Coming soon
Haha i should really do some work so i can remove all the coming soon's
and that would contain the ID for the main category.. So...
[php]
$query = "SELECT * FROM categorys";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$cat_id = $row[cat_id];
$cat_name = $row[cat_name];
print "<b>$cat_name<b>:<br>";
$subs = "SELECT * FROM subcats WHERE sub_cat='$cat_id'";
$subs = mysql_query($subs);
while($row = mysql_fetch_assoc($subs)){
$sub_id = $row[sub_id];
$sub_name = $row[sub_name];
print "<a href=\"subcats.php?id=$sub_id\">$sub_name</a><br>";
}
}
[/php]