could not find driver in wamp php after run -


am using following code connect 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', 'sanoj@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 run php file netbeans ide nothing except

could not find driver 

i tried method checking php.ini file

and read https://stackoverflow.com/a/2852997/3836908 tofind solution cant find whats wrong

i used code in pc worked when try on laptop error how can solve problem

am using windows 64bit previouly used 32bit

sorry bad english!

create file named info.php content:

<?php phpinfo(); ?> 

save , put in server root.
access http://localhost/info.php
see pdo drivers loaded (ctrl + f , type pdo drivers).
mysql pdo driver need loaded this: pdo mysql

if don't see mysql on pdo drivers, should edit php.ini , add extension=pdo_mysql.dll
restart apache , try again in info.php

ps: certify have pdo_mysql.dll in php extensions folder.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -