CodeIgniter 3 でmysql 4.0 に接続
1774 ワード
mysql 4.0 に CodeIgniter 3で接続が出来ないと思って
(入門) CodeIgniter 2 でdatabase接続 - Qiitaを書いていたが、
CodeIgniter 3でも接続する方法がわかった。
サーバ要件 — CodeIgniter 3.2.0-dev ドキュメント (MySQL(5.1+)、mysql*(廃止予定))
設定
- php 5.6にて確認。
config/database.php
- 'dbdriver' => 'mysqli',
+ 'dbdriver' => 'mysql',
あとの方法は CodeIgniter 2 と同じ。
E_DEPRECATED のエラーを抑止
system/database/drivers/mysql/mysql_driver.php
// Error suppression is necessary mostly due to PHP 5.5+ issuing E_DEPRECATED messages
$this->conn_id = ($persistent === TRUE)
? mysql_pconnect($this->hostname, $this->username, $this->password, $client_flags)
- : mysql_connect($this->hostname, $this->username, $this->password, TRUE, $client_flags);
+ : @mysql_connect($this->hostname, $this->username, $this->password, TRUE, $client_flags);
Author And Source
この問題について(CodeIgniter 3 でmysql 4.0 に接続), 我々は、より多くの情報をここで見つけました https://qiita.com/tukiyo3/items/0d2a4b48793533d356d1著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .