Jump to content

Recommended Posts

Hello, I currently have a page with a repeated region that has information from a table with a checkbox proceed each line.

My objective is for the admin (on the frontend) to be able to check multiple boxes and when they press the submit button, the information that is stored in the database should be copied to a new database and deleted from the existing database.

What I currently have is this:

mysql_select_db ($database, $Trial);
$query = "SELECT * FROM contactinfo";
$Record = mysql_query($query, $Trial) or die(mysql_error());
$row = mysql_fetch_assoc($Record);
totalrows = mysql_num_rows($Record);
<form id= "form" name="form" method="post" action="">
<?php do { ?>
<input type = "checkbox" name= "checkbox" id= "checkbox" />
<?php echo $row['ID']; ?>, <?php echo $row['FNAME'], ?>
<?php echo $row['address']; ?>
<?php } while ($row = mysql_fetch_assoc($Record) ?>
<input type="submit" name="button" id="button" value="submit"/>

 

I am not sure how to check whether the checkbox is checked and then where to insert the code (before or after the submit button). I have a basic algorithm but I have no ide how to implement it in PHP. I also know what the SQL statement would be. I have searched and read plenty of books but I just don't know how to put the info together.

 

Any help would be greatly appreciated

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.