Home > Backend Development > PHP Tutorial > 请问上关于zend select()怎么写in的的语句

请问上关于zend select()怎么写in的的语句

WBOY
Release: 2016-06-13 12:57:15
Original
802 people have browsed it

请教下关于zend select()如何写in的的语句
$sales_id=implode(',',$sales_id);
//echo $sale_id的值为4,6,7,8,9,10
$select = $db->select();
$select->from(TB_PRODUCT, '*');
//$select->where(TB_PRODUCT . ".sales_id  IN('.$sales_id.')");
//这句有错误,搜索出来的结果中字段都是 sales_id=>0
$select->where(TB_PRODUCT . ".sales_id  IN('4','6','7','8','9','10')");
//这句是正确的
$select->order(TB_PRODUCT.'.sales_id DESC');
$product_list = $db->fetchAll($select);

想问下,如何写才能使红色字体的这句搜索出来的结果与下面那句一样呢
新人在这里先感谢了


------解决方案--------------------
$select->where(TB_PRODUCT . ".sales_id  IN($sales_id)");
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