Files
PHP-EM-DB/config/db_config.php
2026-10-29 08:36:44 +09:00

25 lines
891 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* データベース接続設定ファイル
*
* このファイルでは、データベースへの接続情報を定義しています。
*/
// データベース接続情報
define('DB_HOST', 'localhost');
define('DB_NAME', 'em_oop_db');
define('DB_USER', 'rezouser');
define('DB_PASS', 'Rezo_0000');
define('DB_CHARSET', 'utf8mb4');
// DSN(Data Source Name)の構築
define('DB_DSN', 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET);
// PDOのオプション設定
define('DB_OPTIONS', [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, // エラーモードを例外に設定
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, // フェッチモードを連想配列に設定
PDO::ATTR_EMULATE_PREPARES => false, // プリペアドステートメントのエミュレーションを無効化
]);