Maison > Article > développement back-end > zendframework中文字段进展筛选,取不出mysql中文字段,英文和数字字段都可以
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 "";