Deleting a row from a MySQL table using PHP
<p>My queries are not getting deleted from the table.  I also want it to return to the first page after deletion.</p>

<pre><code>&lt;html&gt;
&lt;title&gt; Queries&lt;/title&gt;
&lt;body&gt;
&lt;h1&gt; List of Queries&lt;/h1&gt;
&lt;form method=post action="delete7.php"&gt; 
&lt;?php
$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);// Turns off all the notices &amp;warnings
mysql_connect("localhost","root","") or die(mysql_error());//Connects to the DB
mysql_select_db("testdb") or die(mysql_error()); //Selects one database
echo "&lt;br /&gt;";
$query = "select * from queries ";
$result =  mysql_query($query) or die(mysql_error()); //sends a unique query to active database on the server
 $count=mysql_num_rows($result);
echo "&lt;table border=\"1\"&gt;";
echo "&lt;th&gt;&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Address&lt;/td&gt;&lt;td&gt;ContactNo&lt;/td&gt;&lt;td&gt;Query&lt;/td&gt;&lt;/tr&gt;&lt;/th&gt;";
while($row = mysql_fetch_array($result))  
{ 
echo"&lt;tr&gt;";
echo"&lt;td&gt;&lt;input type='checkbox' name='Query[]' value=\"".$row['queryId']."\"&gt; &lt;/td&gt;"; 
echo " &lt;td&gt;" . $row['name'] . "&lt;/td&gt;&lt;td&gt;" . $row['address'] . "&lt;/td&gt;&lt;td&gt;" . $row['contactNo'] . "&lt;/td&gt;&lt;td&gt;" . $row['query'] . "&lt;/td&gt;";
echo"&lt;/tr&gt;\n";
}  
?&gt;
&lt;input type="submit" value="Delete" name="Delete"&gt; &lt;br/&gt;  
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;



&lt;?php 
$conn = mysql_connect("localhost","root","") or die(mysql_error());
$db = mysql_select_db("testdb") or die(mysql_error());
if (isset($_POST['Delete']))  
{
  foreach ($_POST['Query'] as $checkbox) 
  {
    echo "$checkbox";
    $del = mysql_query("DELETE * FROM queries WHERE queryId=

$checkbox") or die(mysql_error());

    if($del)
    { 
      echo ("Records Deleted"); 
    }   
    else
    {
      echo ("No Way");
    }
  }
}
?&gt;
</code></pre>
