I Have following query for mysql.
phpMyAdmin 4.0.10.10
SELECT * FROM `table_name` WHERE DATEDIFF(NOW(), start_date) = 154
I need an equivalent query for Laravel to use DATEDIFF function in where clause.
I Have following query for mysql.
phpMyAdmin 4.0.10.10
SELECT * FROM `table_name` WHERE DATEDIFF(NOW(), start_date) = 154
I need an equivalent query for Laravel to use DATEDIFF function in where clause.
2
Answers
As in you comment, what you need for laravel,
Another way is:
You can try with something like this:
I will not recommend DATEDIFF in the WHERE cuz it could possibly impose a table scan. Instead, I suggest this: