Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,393 members, 7,781,132 topics. Date: Friday, 29 March 2024 at 09:29 AM

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

Nairaland Forum / Science/Technology / Programming / XAMPP Mysql ERROR: PDO Driver Not Found (2033 Views)

PDO::FETCH_CLASS Example / Help Me With PDO / How Do I Retrieve Data With Apostrophe From Mysql Using PDO (2) (3) (4)

(1) (Reply) (Go Down)

XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(m): 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 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 embarassed

Try searching d error code on Google
Re: XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(m): 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. 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. 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. 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(m): 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.

1 Like

Re: XAMPP Mysql ERROR: PDO Driver Not Found by paranorman(m): 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)

How Can I Replicate This In Bootstrap? / Networking, Programming And Web Design; Which One Is More Marketable? / HTML For Absolute Beginner

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.