MySQL / PHP question...

I'm trying to create a menu from a database table, but I'm not sure which loop to use. The tables are: instrument --instrumentID --instrumentName lessons --lessonID --instrumentID --lessonTitle What I'm trying to do is create a menu that looks like this: <li... show more I'm trying to create a menu from a database table, but I'm not sure which loop to use.

The tables are:
instrument
--instrumentID
--instrumentName

lessons
--lessonID
--instrumentID
--lessonTitle

What I'm trying to do is create a menu that looks like this:

<li class="menu-title">$instrumentName</li>
<li><a href="?lessonID=1&instrumentID=1"> $lessonTitle</li>

I am using a while loop right now, but it looks the same lesson for every instrument - even those instruments that don't have any lessons associated to them...

I THINK I need to use a for loop, but I'm not sure how to lay it out to get the desired results...

Your help is GREATLY appreciated!!
3 answers 3