1

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?

HQXU85
  • 153
  • 3
  • 14

1 Answers1

1

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/.

HQXU85
  • 153
  • 3
  • 14