mysql - error with PDO connection in php -


i have php version 5.2.8 on windows 2003 server, trying connect database

$dbh = new pdo("mysql:host=localhost;port=3306;dbname=$db_name", $db_user, $db_pass); 

but when use statement got following error

   fatal error: uncaught exception 'pdoexception' message 'could not find driver'  in bin\db.php:14 stack trace: #0 bin\db.php(14):  pdo->__construct('mysql:host=loca...', 'root', '123') #1  main.php(4): include_once('c:\inetpub\wwwr...') #2  {main} thrown in bin\db.php on line 14 

how can fix problem?

thanks

you must remove ; on line in php.ini :

;extension=php_pdo_mysql.dll extension=php_pdo_mysql.dll  

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -