|  | 
 
 
 楼主|
发表于 2010-9-3 00:04:47
|
显示全部楼层 
| PHP复制代码 复制代码 
 function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ')
 {
  if ($key === NULL  OR ! is_array($values))
  {
   return;
  }
  $not = ($not)  ? ' NOT ' : '';
  foreach ($values as $value)
  {
   $this->ar_wherein[] = $this->escape($value);
  }
  $prefix = (count($this->ar_where) == 0)  ? '' : $type;
 
  $where_in = $prefix . $this-> _protect_identifiers($key) . $not . " IN (" . implode(", ", $this->ar_wherein) . ") ";
  $this->ar_where[] = $where_in;
  if ($this->ar_caching === TRUE)
  {
   $this->ar_cache_where[] = $where_in;
  }
  // reset the array for multiple calls
  $this->ar_wherein = array();
  return $this;
 } | 
 |