I have my own mysql_connect ...etc until i wanted to use ZEND framework in particular with Zend_DB .How do I pass my connection to be used as an adapter to ZEND?
$myconn = mysql_connect('...blab',blah etc..开发者_开发问答.)
eg. Zend_DB_table::setAdapter($myconn);
Don't connect to DB on your own, rather use the factory
$db = Zend_Db::factory('Pdo_Mysql', array(
'host' => '127.0.0.1',
'username' => 'webuser',
'password' => 'xxxxxxxx',
'dbname' => 'test'
));
This way you can connect to DB, but it will connect only once you need the connection and thus optimize for performance...
精彩评论