全文検索:
- 02 DB接続(Singleton)
- 2 DB接続(Singleton) ====== ===== DB接続Class ===== <code php> <?php class Database { public static $... return query($this->_db,$sql); } } </code> ===== 呼び出し側 ===== <code php> <?php require_once('lib/Database.php'); Database::$conf['host']='[host_name]'; $dbh = Database::getDb(); </code> ===== PHP 5.3未満の場合 ===== static, self が利用できない
- 01 Mail class
- bb3291ebf237d4427429]] ===== Mail Class ===== <code|Mail.php> <?php // 言語設定 mb_language("Japanese");... { return $mixed; } } } </code> <code> $mail = new Mail(); $mail->to = 'matsui@hogehoge.com'; $mail->title = 'タイトル'; $mail->body = 'ほ... ; if ($result['status']) { echo "Send NG.\n"; } else { echo "Send OK.\n"; } </code> {{tag>php}}