Public feed
#893387
/**
* Adds an "in" condition to the where clause
* @param $field string Name of the column being examined
* @param $values mixed An array or string
*
* @return Database
*/
public function in($field, $values)
{
if (is_array($values))
{
$escaped_values = array();
foreach ($values as $v)
{
if (is_numeric($v))
{
$escaped_values[] = $this->driver->escape_string($v);
}
else
{
$escaped_values[] = "'".$this->driver->escape_string($v)."'";
}
}
$values = implode(",", $escaped_values);
}
$this->where($this->escape_column($field).' IN('.$values.')');
return $this;
}