no message

This commit is contained in:
a-kizaki
2026-10-29 08:36:44 +09:00
commit a656ab0219
15 changed files with 2117 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
require_once __DIR__ . '/../../config/db_config.php';
/**
* BaseAccessクラス(抽象クラス)
*
* データベースアクセスの基底クラスです。
* 共通のデータベース接続機能を提供します。
*/
abstract class BaseAccess
{
protected ?PDO $pdo = null;
/**
* コンストラクタ
* データベース接続を確立します。
*/
public function __construct()
{
try {
// TODO: PDOを使用してデータベースに接続してください
// ヒント: new PDO(DSN, ユーザー名, パスワード, オプション)
// 接続情報は config/db_config.php で定義されています
// ユーザー: rezouser
// パスワード: Rezo_0000
} catch (PDOException $e) {
throw new Exception("データベース接続エラー: " . $e->getMessage());
}
}
/**
* データベース接続を取得
*
* @return PDO PDOインスタンス
*/
public function getConnection(): PDO
{
return $this->pdo;
}
/**
* 接続を閉じる
*/
public function closeConnection(): void
{
$this->pdo = null;
}
}