₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,620 members, 8,422,886 topics. Date: Tuesday, 09 June 2026 at 12:13 AM

Toggle theme

XAMPP Mysql ERROR: PDO Driver Not Found - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingXAMPP Mysql ERROR: PDO Driver Not Found (2390 Views)

1 Reply (Go Down)

XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(op): 6:56pm On Apr 22, 2017
Hello house,

I am trying to run this on XAMPP's MySQl server:

try {
$con = new PDO("MYSQL:host=locahost;dbname=db_name", "username", "password"wink;
$con->setAttributes(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$query = <<<HERE
SELECT
CONCAT(surname, ' ', firstname) AS 'name',
country
FROM tbl_customerdetails WHERE surname LIKE ? AND firstname LIKE ?;
HERE;
$stmt = $con->prepare($query);
$stmt->execute(array('J%', '%a%'));
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
print "<pre>";
print_r($result);
print "</pre>";
} catch (Exception $e) {
print "ERROR: " . $e->getMessage();
}


I get this error: driver could not be found..

I suppose the driver is supposed to come bundled with the XAMPP app itself.
App's version info: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1

I didn't get this error when I was running the the App version with PHP 5. Can someone help me out with this?! angry huh embarassed
Re: XAMPP Mysql ERROR: PDO Driver Not Found by Eno38151: 7:18pm On Apr 22, 2017
paranorman:
Hello house,

I am trying to run this on XAMPP's MySQl server:

try {
$con = new PDO("MYSQL:host=locahost;dbname=db_name", "username", "password"wink;
$con->setAttributes(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$query = <<<HERE
SELECT
CONCAT(surname, ' ', firstname) AS 'name',
country
FROM tbl_customerdetails WHERE surname LIKE ? AND firstname LIKE ?;
HERE;
$stmt = $con->prepare($query);
$stmt->execute(array('J%', '%a%'));
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
print "<pre>";
print_r($result);
print "</pre>";
} catch (Exception $e) {
print "ERROR: " . $e->getMessage();
}


I get this error: driver could not be found..

I suppose the driver is supposed to come bundled with the XAMPP app itself.
App's version info: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1

I didn't get this error when I was running the the App version with PHP 5. Can someone help me out with this?! angry huh embarassed
Try searching d error code on Google
Re: XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(op): 7:59pm On Apr 22, 2017
Eno38151:
Try searching d error code on Google
Did that, still confused.
check out this link: http://php.net/manual/en/pdo.installation.php

What I think is that the server cannot locate/find the PDO driver in the folder specified in the php.ini config file. I checked the folder, driver was there. I check for the folder specified in the directive, it was correct. still confused but I am going to keep looking. huh huh huh embarassed embarassed embarassed embarassed

Thanks anyway.
Re: XAMPP Mysql ERROR: PDO Driver Not Found by Eno38151: 10:53pm On Apr 22, 2017
paranorman:
Did that, still confused.
check out this link: http://php.net/manual/en/pdo.installation.php

What I think is that the server cannot locate/find the PDO driver in the folder specified in the php.ini config file. I checked the folder, driver was there. I check for the folder specified in the directive, it was correct. still confused but I am going to keep looking. huh huh huh embarassed embarassed embarassed embarassed

Thanks anyway.
Can you specify the exact error code and the printout message 4 d error​.

R u using Windows nd what version??
Do you have any database application on the system?
Re: XAMPP Mysql ERROR: PDO Driver Not Found by Dekatron(m): 11:17pm On Apr 22, 2017
paranorman:
Did that, still confused.
check out this link: http://php.net/manual/en/pdo.installation.php

What I think is that the server cannot locate/find the PDO driver in the folder specified in the php.ini config file. I checked the folder, driver was there. I check for the folder specified in the directive, it was correct. still confused but I am going to keep looking. huh huh huh embarassed embarassed embarassed embarassed

Thanks anyway.
What OS do you use? On Ubuntu, I had the same issue with my php/laravel. You know what? If ubuntu, just use: sudo apt-get install then the driver name (from the stack trace on your command line)
Re: XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(op): 7:52am On Apr 23, 2017
Eno38151:
Can you specify the exact error code and the printout message 4 d error​.

R u using Windows nd what version??
Do you have any database application on the system?
windows 10 pro.
I have db app; Oracle's MySql workbench I don't use much since PHPMyAdmin comes in quite handy for dev purposes. No biggy, still learning. Hope you get my drift.
Re: XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(op): 7:53am On Apr 23, 2017
Dekatron:
What OS do you use? On Ubuntu, I had the same issue with my php/laravel. You know what? If ubuntu, just use: sudo apt-get install then the driver name (from the stack trace on your command line)
Nope bro, windows 10 pro.
1 Reply

PDO::FETCH_CLASS ExampleHelp Me With PDOHow Do I Retrieve Data With Apostrophe From Mysql Using PDO234

Mysql And SQL,,any Difference??What Programming Language Is Best To Learn Data Structures And Algorithms?What Programming Language Is Opay Built With ?