i have problem to delete a data using checkbox ..please help me
this's coding
dataprocessor.php
<?php
@ $db = mysql_pconnect('localhost','root','');
if (!$db)
echo'Error: no connection database. Cuba.';
exit;
}
mysql_select_db('profil1');
$query = "select * from tblprocessor order by Name ";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<center>";
echo "<table border='1' cellpadding='5' cellspacing='8'>";
echo"
<tr> <td >Bil</td> <td>Name</td> <td><input type='checkbox' id='delete' value='delete' title='select or deselect all massage'></td> </tr>";
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
$Name= $row["Name"];
//fetch the result from query into an array
echo "
<tr> <td>".($i+1)."</td> <td>".$row['Name']."</td> <td><input name='delete' type='checkbox' id='delete' value=",$Name,"></td> <td align=center width=10><a href='deleteprocessor.php?Name=$Name'> Delete </a></td> </tr>";
}
echo "</table>";
echo"<button><a href='deleteprocessor.php'>Delete</a></button>"
;
?>
this's coding
deleteprocessor.php
<?php
include '../dbase.php';
if(isset($_POST['delete'])) {
foreach($_POST['checkbox'] as $Name)
{
$query=mysql_query ("DELETE FROM tblprocessor WHERE Name='.$Name.'");
}
if (($query)){
echo "<meta http-equiv='Refresh' content='1; url=dataprocessor.php'>\n";
mysql_close($conn);
} }
?>