Feb 2, 2019
0
Level 14
PHP MYSQL Heroku
My Connection class which just returns a new instance of PDO is throwing an error that i have an invalid name when trying to connect to a JAWSDB on heroku. Works great when im connected locally. I've tested the database im trying to connect to with the same credentials in my config.php, I get the error
invalid data source name
public static function make($config)
{
try {
return new PDO(
$config['connection'] . ';dbname=' . $config['name'],
$config['username'],
$config['password'],
$config['options']
);
} catch (PDOException $e) {
die($e->getMessage());
}
}
Please or to participate in this conversation.