Ex.01 完了

This commit is contained in:
2026-10-28 15:24:50 +09:00
parent 06c1988850
commit 6a0949ca3f

View File

@@ -12,3 +12,20 @@
*
* ※この問題を解く前に、setup.sql を実行してデータベースをセットアップしてください。
*/
// DSN は "mysql:host=localhost;dbname=employee_db;charset=utf8"
$dsn = 'mysql:host=localhost;dbname=employee_db;charset=utf8';
// データベース接続に必要なユーザ名とパスワード
$user = "rezouser";
$password = 'Rezo_0000';
try{
// 橋をかける
$dbh = new PDO($dsn, $user, $password);
echo '接続しました';
} catch (Throwable $th){
echo '失敗しました: ' . $th->getMessage();
} finally {
$dbh = null;
}