The # number in front is there, but it cannot be loaded. Take a closer look, oh, it turns out there is
extension=php_pdo.dll
So, it’s OK
By the way, don’t put it again Copy the dll file under ext to the windows directory, and just add the path to php in the environment variable. This is better. Right?
The original Chinese problem is solved like this
Before querying
mysql_query("set names 'utf8'");
After using pdo
Copy code The 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 all. . .
5 Remember: the character set must be unified, both for the database and the website.
of page
http://www.bkjia.com/PHPjc/319378.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319378.htmlTechArticleThe # number in front is there, but it cannot be loaded. Take a closer look, 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...