php - Fetch records from mysql depending on no. of days last 2 days and 3 days and fifteen days from now() -


in() operator uses exact match of values in paranthesis . want fetch record db in operator respect date. in db there date assigned each record? how can done.

in works dates other types (although should not use floating point values):

where dte in ('2015-01-01', '2014-01-01', '2013-01-01') 

however, last "n" days, use:

where dte > date_sub(curdate(), interval 2 day) 

or whatever logic want.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -