$code = Array(1,2,3,4)
$sql = "SELECT * FROM Table1 WHERE Field1 IN (?)";
$query = $this->db->query($sql, array($code));
$this->db->last_query()
将会呈现
"SELECT * FROM Table1 WHERE Field1 IN ('1,2,3,4')"
如何删除 IN 条件中的单引号?
即使$code
是字符串数组,例如
$code = Array('This one', 'Next code', 'And this')
声明将是:
"SELECT * FROM Table1 WHERE Field1 IN ('This one, Next Code, And This')"
我错过了什么吗?
TIA。