phpmysqliisfuelphp

Fuel\Core\PhpErrorException [ Notice ]: Undefined variable: error when configuring mysql db


I am trying to configure my db (connection strings below)

return array(
'default' => array(
    'connection'  => array(
        'dsn'        => 'mysql:host=Webdatabase; dbname=web_btw',
        'username'   => 'btw_user',
        'password'   => 'pass12',       
    ),
),
);

However, I receive the following PHPErrorException notice (in one of my view files):

<? if (isset($error)): ?><p class="error-msg"><?= $error ?></p><? endif ?>

If possible, I would like to know why it is going to this error message when all I want is to establish db connection to my fuelphp application.

Thank you


Solution

  • Thank you for the suggestions but I have solved the problem by enabling PHP short tags in php.ini to correct the error.