Checkbox inputs and DB search

Active3 hr before
Viewed126 times

2 Answers


A simple solution would be to delete every rows based on your primary key such as movie_id in your case and do insert in loop for every checked checkboxes. That is:, Basically you have a form and you want to remove movies (from a database) whose checkboxes were unchecked on form submission? Is that it? – Yang Jan 3 '16 at 14:59 ,So I thought.. I simply go through the dB with a while loop and compare the db value with the values I get from the checkboxes (via the $_Post method).. I count the values in the $_Post and it shows 2 (checkboxes checked). Database however holds 3 entries ($numberofrecords) for that specific Movie.,Now.. How do I keep track with checkboxes I a later stage So looking at the above example.. for movie_id 2612, I uncheck tag 12 with id 2 as details.

sample code using OP's selected db driver

$sql = 'DELETE FROM movie_tags WHERE movie_id=2612';
foreach($_POST as $checkbox_id => $value) {
   // save your records here
   // To show you the code I'd need to see the HTML for the checkboxes.

Using Some Additional New Features in Oracle Application Express 3.1,Create Application - Select From scratch., Create Application - Select From scratch. ,Select Create Application and click Next.

List of Values Query - Enter:

Y, No;
load more v