0

Hi all, I have an issue with a PHP and MySQL deletion script where I am basically trying to delete all records for meetings which have expired. For this, on input, I have a date input calendar which inputs the date in the format 2010-01-18 to the database with the column set to the date format. I then have the following PHP and MYSQL query to delete expired records:

<?php
$today = date("Y-m-d");
$meetingremoval = mysql_query('DELETE FROM meetings WHERE date < "$today"') or die (mysql_error());
?>

With this code however, nothing is deleted. I have output the $today variable to the screen and it is in the same format as is in the database but the stupid thing won't delete.

Any ideas?

1
Contributor
1
Reply
4
Views
7 Years
Discussion Span
Last Post by jespin
0

Hi all, I have an issue with a PHP and MySQL deletion script where I am basically trying to delete all records for meetings which have expired. For this, on input, I have a date input calendar which inputs the date in the format 2010-01-18 to the database with the column set to the date format. I then have the following PHP and MYSQL query to delete expired records:

<?php
$today = date("Y-m-d");
$meetingremoval = mysql_query('DELETE FROM meetings WHERE date < "$today"') or die (mysql_error());
?>

With this code however, nothing is deleted. I have output the $today variable to the screen and it is in the same format as is in the database but the stupid thing won't delete.

Any ideas?

I Just solved my own problem with the following additions to my code :

$today = date("Y-m-d");
$meetingrquery= "DELETE FROM meetings WHERE date<'".$today."'";
$meetingremoval = mysql_query($meetingrquery) or die (mysql_error());
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.