Rumah > Artikel > pembangunan bahagian belakang > 创建pdo对象时出现Connection failed: could not find driver解决思路
创建pdo对象时出现Connection failed: could not find driver
创建pdo对象的代码:
<br /><?php<br /> try{<br /> $dbh=new PDO("mysql:host=localhost;dbname=name","user","password");<br /> }catch(PDOException $e){<br /> echo 'Connection failed: '.$e->getMessage();<br /> }<br />?><br />
<br />extension=php_mysql.dll<br />extension=php_pdo.dll<br />extension=php_pdo_mysql.dll<br />
<br /><?php<br />phpinfo();<br />?><br />