Hi, this is my table
As you can see in the above table that date is stored in integer format. All I want is to remove time part from this integer date when I will use this date in mysql query.
$event_date=$_POST["event_date"]; //$event_date contains 2017-09-09
$testing_date="SELECT * from testing_date where date('Y-m-d',pub_date)='$event_date'";
$query1=mysqli_query($con,$testing_date);
$result1=mysqli_fetch_array($query1);
I want to fetch all the records of $event_date. So I matched this date with database date column. But the problem is date in database is in integer format and this database date also includes time part in it. And as you see $event_date doesn’t contain any time part. So what should I have to do in the where part of the query so that I can get the exact result.
Also, this date(‘Y-m-d’,pub_date) is not working properly. I used this to convert integer date into date format but I think it’s not converting that’s why my query is not working properly.