Hello:
I've been beating my head against a wall trying to figure this out. I've looked in the MySQL manual and keep finding brick walls instead of paper walls. I need some help to bust through.
I'm trying to write a Where expression so that I can compare a rows DATEEXPIRES date column with the CURDATE() or a string similiar to the current date and neither seems to work.
Here's my code:
<?php
$date_month = date(m);
$date_year = date(Y);
$date_day = date(d);
$time_hour = date(H);
$time_min = date(i);
$Datesession = "$date_year$date_month$date_day";
$jddatefromcurdate = gregoriantojd($date_month, $date_day, $date_year);
$dateexpires = jdtogregorian($jddatefromcurdate);
$dateexpires = strtotime($dateexpires);
$dateyear = date("Y",$dateexpires);
$datemonth = date("m",$dateexpires);
$dateday = date("d",$dateexpires);
$Inactivedate ='$dateyear-$datemonth-$dateday';
include("settings.inc");
mysql_select_db("$mydb", $connection);
$sql = "UPDATE properties SET STATUS='InActive',
DISABLEDDATE='$Inactivedate'
Where DATEEXPIRES < $Inactivedate;
$result = @($sql) or die("Error Deleting Record");
?>
Thanks in advance.
😕