php query from a SELECT result

Let’s say there are three sequential pages, each one has a multiple choice question where I can select AND/OR deselect individual checkboxes elements indicating the answers I have chosen before moving to the next page.

Each user experience on each page is unique so my first experience on page one is ID1 and my next experience on page one is ID4. The individual checkbox elements always have their original ID.

I run a query against the mysql database and I get the results of my select/deselect actions on each page for each element (checkbox).

That query runs FINE.

The issue I am having is AFTER the results are returned.

On page experience ID1 I might check radioButtonID1, then check radioButtonID2, then UNCHECK radioButtonID1 before moving to page two. Etc.

What I need to do is: while a page experience ID is the same (ID1) see if ANY individual checkbox elements were unchecked (meaning the answer was changed) during that page experience.

There are multiple page experience IDs in the returned query and are grouped by the page experience ids. The issue is that I have to loop thru all of the rows but only report back changes that occur when that page experience ID is the same value. I either need two loops or a loop embedded in a loop.

Hope this is clear.

What you could do is store those page answers in a session variable, then on your final page, run a select query and compare those answers against what’s in the session. if there’s any differences, store those in a variable and then when finished, run the update query.

Sponsor our Newsletter | Privacy Policy | Terms of Service