php - Sql Get results older than 10 minutes - wpdb Wordpress query -


hi guys have trouble query need postid's 1 column posts older 10 minutes. time datetime field 2015-03-20 17:15:45 , want work id's - (delete them). empty array. im doing wrong? need each loop? im not this. help

     $getexe = $wpdb->get_results("select postid rejekt time < date_sub( now(), interval 10 minutes");     echo '<pre>';    print_r($getexe);    echo '</pre>'; 

if time_created unix timestamp (int), should able use this:

select postid rejekt time < (unix_timestamp() - 600); 

(600 seconds = 10 minutes - obviously)

otherwise (if time_created mysql timestamp), try this:

select postid rejekt time < (now() - interval 10 minute) 

thanks ivar bonsaksen.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -