Iman Yasmin
Iman Yasmin

Reputation: 447

PDO : Uncaught PDOException: could not find driver

I'm using odbc and XAMPP. I'm receiving the fatal error of could not find driver

Fatal error: Uncaught PDOException: could not find driver in C:\xampp\htdocs\index.php:5 Stack trace: #0 C:\xampp\htdocs\index.php(5): PDO->__construct('odbc:BEGIN') #1 {main} thrown in C:\xampp\htdocs\index.php on line 5

This is the code the error refering to :

$conn = new PDO ("odbc:BEGIN");

Is there any module that I should add to the php.ini like this answer or there are other solution?

Upvotes: 2

Views: 10961

Answers (2)

Far
Far

Reputation: 55

After enabling those extension as @Sarhan said, we need to restart Apache in order for it to work.

Upvotes: 0

Sarhan
Sarhan

Reputation: 61

You need to enable those extensions in order to have ODBC PDO driver working

php_pdo.dll 
php_odbc.dll
php_pdo_odbc.dll

Upvotes: 2

Related Questions