I am starting a new project in work and using my preferred setup of PHP Zend Framework and a MySQL database.
For some reason I can't setup the Zend_Db_Adapter correctly so it will connect to the database successfully. I've setup my database in MySQL and can connect to it using mysql_connect(), but not with the code I've used from past projects? It's really strange!
Here is the code I'm using...
require_once 'Zend/Registry.php';
require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
// Set the database connection information
$params = array('host' =>'localhost',
'username' =>'root',
'password' =>'12345',
'dbname' =>'testdb');
// Assign the database connection to the registry
$db = new Zend_Db_Adapter_Pdo_Mysql($params);
$db->setFetchMode(Zend_Db::FETCH_OBJ);
Zend_Registry::set('db',$db);
Please remember the above parameters work perfectly when I use mysql_connect(), but I get a controller exception error whenever I try using the above?
die;at the end of each line to find out which line is throwing the exception?application.ini.