$startdate = $_GET['startdate']; $enddate = $_GET['enddate']; $action = $_GET['action']; $msg = ""; if ($action == "Delete") { include("../include/dbconfig.php"); $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!"); mysql_select_db($db_name); $query = "DELETE FROM OM_titlesusage WHERE datestamp between '".date("Y-m-d",strtotime($startdate))."' and '".date("Y-m-d",strtotime($enddate))."' "; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $msg = "Deleted ".mysql_affected_rows()." record(s) from ".$startdate." to ".$enddate; } ?>
Materials Usage Maintenance |
|