[eluser]Cong Do[/eluser]
Dam should have read this a bit earlyer.
where not, is already inplemented as where("key !=","val").
I just made my own ones, the difference is that you don't need to use where_in, where_in_or, where_not_in or where_not_in_or.
But just where and whereor

.
function _where($key, $value = NULL, $type = 'AND ')
{
if ( ! is_array($key))
{
$key = array($key => $value);
}
foreach ($key as $k => $v)
{
$prefix = (count($this->ar_where) == 0) ? '' : $type;
if ( ! is_null($v))
{
if(is_array($v))
{
if ( ! $this->_has_operator($k))
{
$k .= ' IN';
}
foreach($v as $kx=>$vx)
{
$v[$kx] = ' '.$this->escape($vx);
}
$v= ' ('.implode(', ',$v).') ';
}
else
{
if ( ! $this->_has_operator($k))
{
$k .= ' =';
}
$v = ' '.$this->escape($v);
}
}
$this->ar_where[] = $prefix.$k.$v;
}
return $this;
}
function _has_operator($str)
{
$str = trim($str);
if ( ! preg_match("/(\s|<|>|!|=|is null|is not null|in|not in)/i", $str))
{
return FALSE;
}
return TRUE;
}
Regards,
Cong Do