I'm writing a php-mysql application. The application allows the user to run a search against the database. When the search is run, if the user clicks on the back button to go back to it after examining an item brought up by it, they are asked if they would like to resend the query (it uses post). Which would rerun the search in the database. Using get wouldn't result in the request to repost - but it would still run the search again.
Is there a way to store the search and recall it, with out rerunning it in the database?
This can be saving it in the database, or somehow in the php - maybe with sessions? There can be a lot of data coming out of these searches, I feel like it's probably too much for sessions.
The other way I can imagine is to store it in the database, in a temporary table of some kind. Creating the table with the columns I intend to query, then selecting into an insert. Then selecting * from the table. This also seems rather like a bad idea. Lots of dynamically created temporary tables floating around.
I know this can be done. Saved searches are things you see in many web applications. So how is it generally done?