in PHP Scripting Language, MyS? php mysql compair date against expire date then change status
Asked by newbe101 in PHP Scripting Language, MySQL Server, WebApplications
Tags: php mysql
hi all,
I have a mysql database with a php front end. In my records I have an add date and an expire date. What I need to do is check and see if any records expire date matches today or earlier and if so, then change record status to 2.
Something like:
$query="SELECT * FROM classifieds WHERE classifieds_approval ='1'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
if (date("m-d-Y") > $expire("m-d-Y")) { $status= "2"; } else { $status="1";}