select query in mysql to select the data before 15 minutes in php -
i have table:
i want select data res_time
within past 15 minutes. using:
select * test res_time >= date_sub(now(), interval 15 minute). select * `test` res_time between timestamp(date_sub(now(), interval 15 minute)) , timestamp(now()).
if using php can this
$beforetime = date("y-m-d h:i:s",strtotime("-15 minutes")); $query = "select * test res_time >= '$beforetime' " ;
if want pure sql solution follow other mentioned solutions.
cheers !!!
Comments
Post a Comment