I was wondering how to generate a hierarchical <select> drop down. Similar to the "Jump to Forum" menu on these boards.

I just need it to go two levels. I want the 1st level to go in an <optgroup>
and the second level items to go in <option>'s.

My category table has typeid, typename, and parent columns. The top level items have a NULL parent value and the second level items have the typeid of the parent in the 'parent' column.

I'm looking for something like this

Parent <optgroup>
- Child <option>
- Child <option>
- Child <option>
Parent <optgroup>
- Child <option>
Parent <optgroup>
- Child <option>
- Child <option>

You get the idea...

- Thanks