【发布时间】:2013-02-20 07:39:15
【问题描述】:
我第一次尝试使用 PDO 创建一个应用程序,并且当我
try {
$db = new PDO('mysql:host=localhost;dbname=DBname', 'user', 'pass');
} catch(PDOException $e){
echo '<div class="errorMSG">Failed to connect to database. Please try to refresh this page in 1 minute. However, if you continue to see this message please contact your system administrator.</div>';
echo '<br /><br />' . $e->getMessage();
exit();
}
当然,我已经将用户和 DBname 更改为正确的一次,但我得到了一个错误 找不到驱动程序
因此,通过少量搜索,我发现我需要启用 pdo_mysql,但我似乎无法找到我在哪里以及如何执行此操作? 有人可以帮助我如何启用它和/或让它在我的本地机器上工作。我有Windows 7。 我找不到我的 php.int 所在的位置。
谢谢:)
【问题讨论】: