am using following code to connect to database
//database credentials
define('DBHOST', 'localhost');
define('DBUSER', 'sanoj');
define('DBPASS', '123456');
define('DBNAME', 'test');
//application address
define('DIR', 'http://www.blogtom.com/');
define('SITEEMAIL', 'sanoj26692@gmail.com');
try {
//create PDO connection
$db = new PDO("mysql:host=" . DBHOST . ";port=3306;dbname=" . DBNAME, DBUSER, DBPASS);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$db->exec("SET NAMES 'utf8';");
} catch (PDOException $e) {
//show error
echo '<p class="bg-danger">' . $e->getMessage() . '</p>';
exit;
after i run my php file from netbeans ide i get nothing except this
could not find driver
i tried all method checking php.ini
file
and even read this https://stackoverflow.com/a/2852997/3836908 tofind some solution but cant find whats wrong
i used this code in PC it worked well but when i try this on my laptop i get this error how can i solve this problem
am using windows 64bit but previouly i used 32bit