Hello everyone I got a database that looks like that
Category.name,category.id
Sub_category.name,sub_category.id,sub_category.belong_to_id
Basically when I pull the menu I need to make something like this:
$query = mysql_query("SELECT * FROM category");
while($category = mysql_fetch_assoc($query) {
echo '<li>'.$category[name].'<li>';
}
and then make a sql query for each sub category inside the while loop it looks useless to me, and I can't figure a way how to do this with inner joins, because i need to seperate the menu.
I don't want nested loops