Deleting Certain Records.
Posted: Thu Mar 31, 2005 12:23 pm
I need the code delete all the records from the table that contain a certain date. I wrote the following code but it doesn't work. If anybody would be so kind to assist me into fixing it I would be forever thankfull.
Thanks in advance.
Code: Select all
<?php
$submit = $_POST["submit"];
if ($submit) {
$month = $_POST["month"];
$connection = mysql_connect("localhost", "***", "****") or die("connect");
mysql_select_db("*****",$connection) or die ("Unable to select requested database.");
$deleteresult = mysql_query;
("DELETE FROM `auth` WHERE month = '$month'");
$result=mysql_query($deleteresult, $connection);
$affected_rows=mysql_affected_rows( $connection);
echo "<b>Check</b> was executed.";
}
?>