session_start(); require "../cdn/security.php"; require("../pass/db-pass.php"); // 変数の初期化 $sql = null; $res = null; $dbh = null; ?> try{ $dbh = new PDO($dsn, $user, $password); // SQL作成 $sql='SELECT * FROM `thread`'; $res = $dbh->query($sql); $res->execute(); $count=$res->rowCount(); // SQL実行 $res = $dbh->query($sql); // 取得したデータを出力 foreach( $res as $value ) { $id = htmlspecialchars($value['id'], ENT_QUOTES); } //$dbh->query('SET NAMES utf8'); }catch (PDOException $e){ print('Error:'.$e->getMessage()); die(); } // 接続を閉じる $dbh = null; //header ('pdo insert.php'); //exit; ?>