zendframework中文字段进展筛选,取不出mysql中文字段,英文和数字字段都可以

WBOY
Release: 2016-06-13 12:59:30
Original
1004 people have browsed it

zendframework中文字段进行筛选,取不出mysql中文字段,英文和数字字段都可以
以下是IndexController.php控制器部份,这部份用中文字段进行筛选,无法取出记录

<br />
<?php<br />
require_once 'Zend/Controller/Action.php';<br />
require_once 'application/models/goods.php';<br />
require_once 'application/models/db.php';<br />
require_once 'BaseController.php';<br />
<br />
<br />
	class IndexController extends BaseController<br />
	{<br />
		<br />
		function indexAction()<br />
		{<br />
			$this->view->title='aaaa';					<br />
			$goods=new goods();		<br />
			$dbs=$goods->getAdapter();//适配器查询返回的数据是数组		<br />
			$cname="索尼高性价比入门单反  A580 单反相机【演示数据】";<br />
			$res=$dbs->query("select * from shopnc_goods where goods_name=".$dbs->quote($cname)." limit 0,9")->fetchAll();	<br />
			echo "<pre class="brush:php;toolbar:false">";<br />
			print_r($res);<br />
			echo "
Copy after login
";
exit();

}

}


------解决方案--------------------
确认表中确有此串
确认编码没有搞错

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!