I have date type input on my site. I want to check if selected date is in the database and also is greater than for example 2017-01-01. I have something like this. How to do that?
if(ISSET($_POST['receipt_date'])) {
$receipt_code=$_POST['receipt_date'];
$checkdata="SELECT receipt_date FROM receipts WHERE receipt_code='$receipt_code' ";
$query=mysql_query($checkdata);
if(mysql_num_rows($query)>0) {
echo "exist";
} else {
echo "ok";
}
exit();
}