Fix issue with Query_Builder->where_in() method
This commit is contained in:
parent
a4f730b081
commit
4c546ed3e9
@ -698,12 +698,12 @@ class Query_Builder {
|
||||
$key = $this->quote_ident($key);
|
||||
$params = array_fill(0, count($val), '?');
|
||||
|
||||
foreach($val as &$v)
|
||||
foreach($val as $v)
|
||||
{
|
||||
$this->values[] = $v;
|
||||
}
|
||||
|
||||
$string = $key . " {$in} ".implode(',', $params).') ';
|
||||
$string = $key . " {$in} (".implode(',', $params).') ';
|
||||
|
||||
$this->query_map[] = array(
|
||||
'type' => 'where_in',
|
||||
|
@ -173,6 +173,19 @@ abstract class QBTest extends UnitTestCase {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
public function TestWhereIn()
|
||||
{
|
||||
if (empty($this->db)) return;
|
||||
|
||||
$query = $this->db->from('create_test')
|
||||
->where_in('id', array(0, 6, 56, 563, 341))
|
||||
->get();
|
||||
|
||||
$this->assertIsA($query, 'PDOStatement');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
public function TestSelectAvg()
|
||||
{
|
||||
if (empty($this->db)) return;
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user