php - select record from mysql that were inserted in last (3,4,5) days from current date -


select record mysql inserted (3,4,5) days current date

example: select id tbl date(created)in (3,4,5)

select job_tbl_id job_post dayofmonth(date(created)) in (3,4,15)  

tbl:job_post

''''''''''''|'''''''''''''''''''''''''''| job_tbl_id  |  created                  | '''''''''''''|''''''''''''''''''''''''''''' 1            |2015-07-01 18:06:32 2             2015-06-30 19:14:42      

the code not perfect one. choose if no other solutions satisfies you.

$condition=''; foreach($your_selected_dates $value) {   if($condition!='')       $condition.=" or ";   $condition.=" date(created) = ( curdate() - interval ".$value." day ) "; }  $your_qry="select job_tbl_id job_post ".$condition; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -