0) { $sql = " SELECT bf_file FROM {$g5['board_file_table']} WHERE bo_table = '{$bo_table}' AND wr_id = '{$wr_id}' "; $result = sql_query($sql); while ($file = sql_fetch_array($result)) { if (preg_match('/\.pdf$/i', $file['bf_file'])) { $has_pdf = true; break; } } } // PDF가 있을 때만 뷰어 출력 if ($has_pdf) { echo '