Hi Every 1..!

I m new in DaniWeb plz help me out by solving my problm spcific to PHP (checkbox control).
I want delete multilple data from mysql using php form checkbox control.
I want to display data in a table as i did and then want to select multiple choices using checkboxs to delete it.

Consider the following:

<?php
if(isset($_POST['btnDelete'])){
	for($i=1;$i<=4;$i++){
		if(isset($_POST['checkbox'.$i])){
			echo "<br>".$_POST['checkbox'.$i];
		}
	}
}

?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="">
  <table width="301" height="129" border="1" cellpadding="0" cellspacing="1">
    <tr> 
      <td width="21"><strong>Sl</strong></td>
      <td width="245"><strong>Item</strong></td>
      <td width="31"><strong>Tick</strong></td>
    </tr>
    <tr> 
      <td>1</td>
      <td>Apple</td>
      <td><input type="checkbox" name="checkbox1" value="Apple"></td>
    </tr>
    <tr> 
      <td>2</td>
      <td>Baby</td>
      <td><input type="checkbox" name="checkbox2" value="Baby"></td>
    </tr>
    <tr> 
      <td>3</td>
      <td>Cat</td>
      <td><input type="checkbox" name="checkbox3" value="Cat"></td>
    </tr>
    <tr> 
      <td>4</td>
      <td>Dog</td>
      <td><input type="checkbox" name="checkbox4" value="Dog"></td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td><input type="submit" name="btnDelete" value="Delete"></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>

Hope this would help.

This article has been dead for over six months. Start a new discussion instead.