select query in mysql to select the data before 15 minutes in php -


i have table:

enter image description here

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

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -