I saw a question come up involving chained selects on the sitepoint php forums. I have wresteled with that problem quite a bit and as a result it lead me to publish almost a books worth of info to the thread.
http://www.sitepoint.com/forums/showthread.php?p=1587493&posted=1#post1587493
How could you get it to read from a mysql_query?
That’s kind of a broad question. It’s been almost 9 months since I wrote that post so I am pretty out of touch with it’s contents. If you need immediate help I would suggest doing a google search on ‘chained selects’ or ‘linked selects’. The thread I linked to above also has quite an abundance of information as well.
Now, if you have a little bit of time to spare, let me know what version of PHP you are using and I’ll see if I can throw a little article together for you this weekend.