I don't how to confirm multliple records at once by checkbox?
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="test_mysql1"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
?>
<form id="form" name="form" method="post" action="accept.php"><table border='1' cellspacing='0' width='612'>
<tr>
<th bgcolor='green'><font color='white'>#</font></th>
<th bgcolor='green'><font color='white'>Id</font></th>
<th bgcolor='green'><font color='white'>Name</font></th>
<th bgcolor='green'><font color='white'>Lastname</font></th>
<th bgcolor='green'><font color='white'>Email</font></th>
</tr>
<?php
$i = 0;
$number = 0;
while($row = mysql_fetch_array($result)){
$number++;
?>
<?php
$i++;
if($i%2)
{
$bg_color = "#EEEEEE";
}
else {
$bg_color = "#E0E0E0";
}
?>
<tr bgcolor='". $bg_color ."'>
<td><center><Strong><font color='red'><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $rows['id']; ?>">
</font></Strong>
</center></td>
<td><center><Strong><font color='red'><?php echo $row['id']; ?></font></Strong></center></td>
<td><center><Strong><?php echo $row['name']; ?></font></Strong></center></td>
<td><center><Strong><?php echo $row['lastname']; ?></Strong></center></td>
<td><center><Strong><?php echo $row['email']; ?></Strong></center></td>
</tr>
<?php } ?>
</table>
<div class="select"><strong>Other Pages: </strong>
<select>
<option>1</option>
</select>
</div>
<label>
<input name="accept" type="submit" id="accept" value="Accept">
</label></form>
accept.php
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name1="test_mysql1"; // Table 1 name
$tbl_name2="test_mysql2"; // Table 2 name
$tbl_name3="test_mysql3"; // Table 2 name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
if(isset($_POST['accept'])) {
foreach($_POST['checkbox'] as $id){
$usersid = mysql_query("SELECT * FROM ".$tbl_name1." WHERE id=".$id."");
$row = mysql_fetch_array($usersid);
$username = ($row['username']);
$users = mysql_query("SELECT * FROM ".$tbl_name2." WHERE users =".$username."");
$row1 = mysql_fetch_array($users);
$section = ($row1['section']);
mysql_query("UPDATE ".$tbl_name3." SET Status = 'Complete' WHERE section =".$section."");
}
header('Location: admin.php');
}