A
Anonymous
Guest
I have this code that pulls the categories and sub categories from a database.... how can i get it to indent sub categories...
thanks in advance
I want it to look like
thanks in advance
Code:
function build_menu ($category_id)
{
db_connect();
$query = mysql_query('SELECT * FROM `categories` WHERE `sub_category_of` =' . $category_id);
while($row = mysql_fetch_array($query))
{
print($row['category_name'] . "<br>\r");
}
build_menu($row[category_id]);
}
I want it to look like
Code:
wheels
15"
16"
17"
accessories
keyboard
wireless
mice