I have a datepicker with the format d/m/Y
:
<input type="text" name="date" id="single_cal4" class="form-control has-feedback-left" aria-describedby="inputSuccess2Status4">
If the date is changed I want to run an SQL statement that needs to select the id
from the database WHERE the year is the same year as the selected year in the datepicker.
Does someone know how I can run an SQL statement that runs an WHERE with the selected year from the datepicker?
Here is my SQL statement:
$sql = SELECT id FROM `trans` WHERE user_id='". $_SESSION['user_id'] ."' AND year(date) = ";