I'm really struggling to delete records using the following code. I'm not sure where I'm going wrong... could somebody help me please:
@ $db = mysql_pconnect("home.gov.gg", "username", "password"
if (!$db)
{
echo "Error: Could not connect to the database!";
}
mysql_select_db("database"
$month = date("m"
$day = date("d"
$year = date("Y"
$older = date("Y-m-d", mktime(0,0,0,$month,$day-60-date("w",mktime(0,0,0,$month,$day,$year)),$year));
echo $older;
$query = "DELETE FROM diary WHERE datestart<'".$older."'";
$ExecuteDeletion = mysql_query($query);
mysql_close($db);
@ $db = mysql_pconnect("home.gov.gg", "username", "password"
if (!$db)
{
echo "Error: Could not connect to the database!";
}
mysql_select_db("database"
$month = date("m"
$day = date("d"
$year = date("Y"
$older = date("Y-m-d", mktime(0,0,0,$month,$day-60-date("w",mktime(0,0,0,$month,$day,$year)),$year));
echo $older;
$query = "DELETE FROM diary WHERE datestart<'".$older."'";
$ExecuteDeletion = mysql_query($query);
mysql_close($db);