Hi people,
I have a database column called date type is date.
I am using a search to bring results by date. My code for this is:
<label><b>Date</b></label>
<input type="date" name="date" value="<?php if(isset($_GET['date'])){ echo $_GET['date']; } ?>" class="form-control">
If for example I made an entry on January 5th the date shows 2023-01-05 in the date field
What i want to do is search by Month so all records for that Month would show.
So if i searched January it would include the results including January 5th. Or if I searched say December it would show any results that were from any date in December and so on ?
I have tried this but its not working.
"SELECT * FROM staffcall WHERE month(date) = ?"
Maybe a search input using month and year as after 12 months it would repeat ?
Any advice please ?
Many Thanks