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

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

WBOY
WBOYOriginal
2016-06-13 12:57:15797browse

请教下关于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)");
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