LoginSignup
1
0

More than 1 year has passed since last update.

fuel.phpのFuel\Core\Database_Exception [ 2014 (2014) ]:エラー

Posted at

このエラーはfuel.phpのバージョンが18.1以降にDBの接続方法が
mysqliの時に起きました。
対処法は簡単

app>config>db.phpの中の以下の[active]の箇所をpdoに変更するだけ。

fuel.php
return array(
  'active' => 'mysqli',

  'pdo' => array(
       //ここを変える
         'type' => 'pdo',
                   //接続配列
         'connection' => array()
               //PDOの接続DSN(データソース名)
              'dsn' => 'mysql:host = localhost; dbname = db名',
               'username' => 'root',
               'password' => 'root',
                     //永続的に接続するかどうか
               'persistent'     => false,
                             //MYSQL、MYSQLiを使用するときにクライアント圧縮するかどうか
               'compress'       => false,

         )
            //テーブル接頭辞(Wordpressのテーブルの前のwp_...みたいなやつ)
            'table_prefix' => '',
            'caching' => false,
            'profiling' => true,
),

  'mysqli' => array(
        'type'           => 'mysqli',
        'connection'     => array(
            'hostname' => 'localhost',
            'database' => 'framework',
            'username'       => 'root',
            'password'       => 'root',
            'persistent'     => false,
            'compress'       => false,
        ),

        'table_prefix' => '',
        'charset'      => 'utf8',
        'caching'      => false,
        'profiling'    => true,
    ),
  );

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0