After upgrading PHP from 5.5 to 7.1 and FuelPHP from 1.7.2 to 1.8.1, I have below "invalid data source name" error in compile method.
[FATAL] index.php <:63> : [2018/06/08 02:47:26] invalid data source name
[FATAL] index.php <:64> : [2018/06/08 02:47:26] Array
(
[0] => Array
(
[file] => /var/www/fuel/core/classes/database/pdo/connection.php
[line] => 434
[function] => connect
[class] => Fuel\Core\Database_PDO_Connection
[type] => ->
[args] => Array
(
)
)
・・・
Additional information, in the case of not including where query, I have no error.
Below was succeed.
$query = DB::select('*')->from('table_name');
$sql = $query->compile('my_db_connection');
But below was faild.
$query = DB::select('*')->from('table_name');
$query->where('column_name', 'hogehoge');
$sql = $query->compile('my_db_connection');
How can I resolve this error?
Check your DB setting. Fuel needs a correct DB connection to escape the parameter of where().
sorry I have presented a wrong solution.