Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
$database is empty when the _select_db function is called
  • Hi,
    I have an issue with my connection :
    $database is empty when the _select_db function is called I have a mysql database
    I have of course configures my db.ph file return array(
    'default' => array(
    'connection' => array(
    'dsn' => 'mysql:host=localhost;dbname=blog',
    'username' => 'root',
    'password' => '',
    ),
    ),
    ); any idea ?
    (if I put a $database='blog' just before the call it works aof course) thx
  • I'm a bit confused here. _select_db() is a method in the MySQL and MySQLi connection drivers. But you're using PDO syntax in your db.php? What driver is configured (it's in app/config/db.php)? If not PDO, remove the 'dsn', and replace it by hostname, port, username, password and database, as described in the documentation.
  • Ok it works now. First I had switched to mysql because I tought it is what I have to do. But now I have configured PDO and it's OK
    thks for your help
    fabien

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion