exec('SET NAMES utf8');。 编码基本一致,查询如id=5时正常返回中文数据。 使用$sql="SELECT * FROM table WHERE name LIKE '%$中文%'";没有返回结果。。。。求"/> exec('SET NAMES utf8');。 编码基本一致,查询如id=5时正常返回中文数据。 使用$sql="SELECT * FROM table WHERE name LIKE '%$中文%'";没有返回结果。。。。求">

数据库-编码一致,php查询中文时无返回结果

WBOY
Release: 2016-06-02 11:28:00
Original
1010 people have browsed it

php数据库

PHP文件补充了header("Content-Type:text/html;charset=utf-8");,数据库是UTF-8编码,查询字段也是UTF-8,php中PDO查询时也$pdo->exec('SET NAMES utf8');。
编码基本一致,查询如id=5时正常返回中文数据。
使用$sql="SELECT * FROM table WHERE name LIKE '%$中文%'";没有返回结果。。。。求大神帮帮忙。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!