'i want to pickup the persons who have an end of their contract in period of 6 months
$query ="SELECT *
FROM expiration
where 'expirationdate' BETWEEN (DATE_FORMAT(curdate(),'%m/%d/%Y')) AND (DATE_FORMAT(curdate()+ INTERVAL 6 MONTH,'%m/%d/%Y'))";
where is the problem
Solution 1:[1]
Column names must be in Backticks see When to use single quotes, double quotes, and backticks in MySQL and as mentioned don't convert the date column
$query ="SELECT *
FROM expiration
where `expirationdate` BETWEEN curdate() AND curdate() + INTERVAL 6 MONTH";
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
