'SET NAMES utf8mb4' ) ); $now = date('Y-m-d H:i:00' ); // 1分毎 $sql = "SELECT * FROM `newsboard` WHERE `status` = 'OPEN' AND `open_time` < '".$now."' ORDER BY `open_time` DESC LIMIT 1;"; $resulte = $dbh->query( $sql ); $newsboard_res = $resulte->fetchall(PDO::FETCH_ASSOC); // print_r( $newsboard_res ); $p_web_nos = json_decode( $newsboard_res[0]['web_nos'] ); $no_where = ''; if( $p_web_nos ) { foreach( $p_web_nos as $db_key => $p_web_no ) { $sql = "SELECT * FROM `web` WHERE `no` = '".$p_web_no."' LIMIT 1;"; $resulte = $dbh->query( $sql ); $p_web_res = $resulte->fetchall(PDO::FETCH_ASSOC); $target_res[] = $p_web_res[0]; $no_where .= " AND `no` != '".$p_web_no."' "; } } $select_count = 100 - count( $p_web_nos ); $sql = "SELECT * FROM `web` WHERE `status` = 'OPEN' AND `open_time` < '".$now."' AND ( `end_time` > '".$now."' OR `end_time` IS NULL ) ".$no_where." ORDER BY `open_time` DESC, `url` DESC LIMIT ".$select_count.";"; $resulte = $dbh->query( $sql ); $web_res = $resulte->fetchall(PDO::FETCH_ASSOC); foreach( $web_res as $db_key => $web_data ) { $target_res[] = $web_data; } $sql = "SELECT * FROM `corner`;"; $resulte = $dbh->query( $sql ); $corner_all_res = $resulte->fetchall(PDO::FETCH_ASSOC); $corner_no_array = array(); foreach( $corner_all_res as $db_key => $db_data ) { $corner_no_array[ $db_data['no'] ] = $db_data; } ?> OK! JAPAN | ライフスタイル&セレブリティーマガジン

NEWS BOARD
新着記事一覧

$db_data ) { $match_array['<-DB:target-'.$db_key.'->'] = $db_data; } if( strtotime( '-1 day', time() ) < strtotime( $target_data['open_time'] ) ) { $match_array['<-DB:target-title->'] = 'NEW!! '.$match_array['<-DB:target-title->']; } $match_array[ '<-DATE->' ] = date("Y.m.d", strtotime( $target_data['open_time'] ) ); $viewText = strtr( $tempText, $match_array ); echo $viewText; } ?>