What I usually do in a case like this is to have one MENU table with fields for levels and parents. Then in one query I either get every item, grouped by level and parent. So the dataset returned is like uhm…
ID Text Level ParentID
1 Animals 0 0
2 Dogs 1 1
3 Beagles 2 2
4 Great Danes 2 2
5 Cats 1 1
6 Calico 2 5
7 Tabby 2 5
8 Cars 0 0
9 American 1 8
10 Ford 2 9
11 Chevy 2 9
12 Japanese 1 8
13 Toyota 2 12
14 Honda 2 12
Then I use server-side code to spit out HTML around those items based on their level and parentID, ending up with HTML like
<ul>
<li>Animals
<ul><li>Dogs
<ul><li>Beagles</li>
<li>Great Danes</li></ul>
</li>
<li>Cats
<ul><li>Calico</li>
<li>Tabby</li></ul>
</li></ul>
</li>
<li>Cars
<ul><li>American
<ul><li>Ford</li>
<li>Chevy</li></ul>
</li>
<li>Japanese
<ul><li>Toyota</li>
<li>Honda</li></ul>
</li>
</li>
</ul>
Is that the sort of thing you want to do, or do you really need actual lookups because it’s an actual “combination chooser” instead of defined lists?
Perhaps if you Google “php ajax menu” or “php ajax dropdown” that might give you some more insight, too?