2

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?

Community
  • 1
  • 1
Iman Yasmin
  • 447
  • 2
  • 11
  • 31

2 Answers2

2

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

php_pdo.dll 
php_odbc.dll
php_pdo_odbc.dll
Sarhan
  • 61
  • 6
0

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

Far
  • 55
  • 2
  • 13