有没有什么办法解决这一问题?
有没有什么办法解决这一问题?
$dbh = new PDO('MysqL:host=localhost;dbname=test',$user,$pass,array( PDO::ATTR_PERSISTENT => true )); $config = new \Doctrine\DBAL\Configuration(); $connectionParams = array( 'dbname' => 'mydb','user' => 'user','password' => 'secret','host' => 'localhost','pdo' => $dbh,); $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams,$config);
请务必了解与PDO使用持久连接的含义:What are the disadvantages of using persistent connection in PDO