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

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

WBOY
WBOYOriginal
2016-06-13 11:09:31827browse

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 "
";
exit();

}

}


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

Statement:
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