$sSql = "SELECT * FROM table1 where field1 > 0 and field2 IN (:buzzGroups) and active = 1";
$arrParams = array('buzzGroups' => $vBuzzGroups);
$stmt = $this->tableGateway->getAdapter()->createStatement($sSql);
$stmt->prepare($sSql);
$data = $stmt->execute($arrParams);
这里是$vBuzzGroups = '10,12';
的值。
当我仅传递单个值时,它可以工作,但当我尝试使用多个值(用逗号分隔)时,它会给出错误信息。
Conversion failed when converting the nvarchar value '10,12' to data type int
有没有人遇到过这个问题?
$vBuzzGroups = array(10,12)
。也许这里也是一样的? - danopz