How to make menu link include a SQL query

My site has about 80 pages, all identical apart from a search query to produce the books for that menu item. If each of the 80 menu buttons went to a page, but with the search query actually in the URL link, I would only need one page.
How would I do this?
I think I could set up buttons in forms with hidden inputs but it would be nice to have a cascading menu to save space.

I would definitely take a look at the postswitch stack from Bryn Owen.

Wow, I never found that! Thank you so much. I’ve written to him to see if you can pass more than one keyword. Thanks again.

From what I understand, (I just bought it 2 days ago as well) The stack sets a variable called confirmswitch by default, You can alter the PHP flag field to have the stack use a different variable. I think in this way multiple stacks could be included on a page.

Bryn has kindly taken the time to ask exactly what I’m doing, and I’ll finish this thread with whatever happens.

I’ve now used PostSwitch to pick up the variable and its value that I add to a URL, …and I am still struggling to get a different stack (Stackapps) to use that variable. Though PostSwitch is happy to display according to the variable I need it to work with Stackapps to work with a large database.
Thanks again for your suggestion!