I am building a ColdFusion-based search results page where the visitor can select a checkbox next to each result for comparing two or more records on the page.
Once they click the submit button I need to be able to show just those records that were selected on a new page so that the visitor can compare the results against each other. The checkbox passes the ID of that record to a SELECT statement to build the query.
The problem I am having is each checkbox on the results page is called "compare" and passes each unique ID in the URL string to the comparison page as the same variable. So, how do I loop through each ID, pass it to my query, and output the result set on the new page?
One thought I had was to store each ID in an array and loop over the SQL query for each record in the array. But then how do I get that into one recordset that I can output to my comparison page?