The # number in front is gone, but it cannot be loaded. If you look carefully, oh, it turns out there is
extension=php_pdo.dll
So, it’s OK
By the way, don’t copy the dll file under ext to the windows directory. After downloading it, just add the php path to the environment variable, which is better. right?
The original Chinese problem is solved like this
Before querying
mysql_query("set names 'utf8'");
After using pdo
Copy the codeThe code is as follows:
$dbh = new PDO( $dsn, $user, $pass); //Initializing a PDO object means creating a database connection object $dbh
echo "Connection successful
";
//You can also perform a search operation
$ dbh->query("set names utf8"); //That's it. . .
The above introduces the precautions for loading new changes in ph php5 pdo, including ph content. I hope it will be helpful to friends who are interested in PHP tutorials.