I'm having an problem with my PHP event calendar. I allready Searched but can't find an solution. In particular I have an mysql database with an datetime field. In my PHP page I have an for loop to get the events for that date. And need to search with an select query in my database in the datetime field. I only need to have to search in date (not with time). Problem is that I can't get the right value for my search query? I've tried with converting strtotime, etc... but Notting seams to work!? I have similar questions read on this forum but didn't find an answer. Thx for the help allready. Here is my code:
<?php
For ($i=1; $daycount; $i++){.
$date = $showmonth.'-'.$i.'-'.$showyear;
$query = mysqli_query($conn, "SELECT id FROM tblname WHERE date="'.$date.'");
...
Additional info: in my mysql database I have 3 fields id (int), events (varchar), date (datetime). I have an separeted form dat post the content into the database. Here I work with mktime and this works fine. But on my showcalender.php page I have build with JavaScript, css an calendar. I used before (in an previous version) an field (in my mysql db) the type varchar (instead of datetime)to save my date and than it work wel to collect and get the events list up in my showcalender.php. But I changed the field (in mysql) date in an datetime because I want to calculate with it. Probleem is that I can not convert my $date correct now to collect my events.