I am trying to redirect users if they try to edit a record that has expired according to the date entered in the DATE field. It works great, but the <now() includes today as well as all other historic dates and thus is redirecting if DATE = today..... such records havent technically expired. Any ideas what to replace the <now() with? $strSQL = "select `DATE` from TABLE where ID=".$_REQUEST["editid1"]; $rs = db_query($strSQL,$conn); $data = db_fetch_array($rs); if ($data["DATE"]<now()) { header("Location: other.php"); } else { } Code (markup):
Why dont you get the date converted in required format first using php and then pass it into the mysql query so that you can get the proper result