내 구문이 올바른지 확인해 주시겠습니까? 이 코드를 사용하여 오류가 발생하지는 않지만 제대로 수행하고 있는지 여부에 대한 의견이 거의 없습니다.시간보다 작고 큰 쿼리
/* Work out blog of the day */
$featured_id = get_option('featured_blog'); # Current ID
$featured_time = get_option('featured_time'); # Current Time
if($featured_time > time()-86400 && $featured_time < time()-604800) // more than 1 Day ago but less than a week
{
$query = "SELECT blog_id FROM `wp_blogs` WHERE public = '1' and archived = '0' and spam = '0' and deleted = '0' AND blog_id NOT IN ('".$featured_id."', '1','27') ORDER BY rand() limit 1";
$featured_id = $wpdb->get_var($query);
update_option('featured_blog', $featured_id);
update_option('featured_time', time());
}
오류가없는 경우 올바르게 수행하고 있습니다. 그것이 좋은지 아닌지를 결정하기 위해 시스템 시간과 데이터베이스 시간의 차이점을 고려할 수 있습니다. –
당신은 락! 감사 ! – DFreeman