Reputation: 163
I am trying to connecting PDO on my local server. I'm using Windows 7 Professional 64-bit and have AppServ installed. In a php document I use the following code for connection:
<?php
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', 'password');
?>
But the code turns out to be an error: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\AppServ\www\a.php:2
I checked phpinfo() and it shows that sqlite and sqlite2 are the only two databases installed in PDO. So how can I install MySQL PDO?
Upvotes: 1
Views: 1423
Reputation: 163
Thank you all. I just removed the semicolon in the php.ini file for MySQL and it works! The default location of php.ini file is in C:/Windows/.
Upvotes: 1