public function where($where, $glue = 'AND')
    {
        if(is_array($where) && count($where) != 0) {
            foreach($where as $field => $value) {
                $array[] = " `$field` = ".((is_string($value) ? "'$value'" : $value));
            }
            $this->where = " WHERE".implode(" $glue", $array);
        }
        elseif(is_string($where) && trim($where) != '') {
            $where = trim($where);
            $where = trim($where, 'WHERE ');
            $where = rtrim($where);
            $this->where = ' WHERE '.$where;
        }
        return $this;
    }
public function where($where, $glue = 'AND')
    {
        if(is_array($where) && count($where) != 0) {
            foreach($where as $field => $value) {
                $array[] = " `$field` = ".((is_string($value) ? "'$value'" : $value));
            }
            $this->where = " WHERE".implode(" $glue", $array);
        }
        elseif(is_string($where) && trim($where) != '') {
            $where = trim($where);
            $where = trim($where, 'WHERE ');
            $where = rtrim($where);
            $this->where = ' WHERE '.$where;
        }
        return $this;
    }
public function where ( $ where , $ glue = 'AND' ) { if ( is_array ( $ where ) && count ( $ where ) != 0 ) { foreach ( $ where as $ field => $ value ) { $ array [ ] = " `$field` = " . ( ( is_string ( $ value ) ? "'$value'" : $ value ) ) ; } $ this -> where = " WHERE" . implode ( " $glue" , $ array ) ; } elseif ( is_string ( $ where ) && trim ( $ where ) != '' ) { $ where = trim ( $ where ) ; $ where = trim ( $ where , 'WHERE ' ) ; $ where = rtrim ( $ where ) ; $ this -> where = ' WHERE ' . $ where ; } return $ this ; }
Create WHERE clause

@param   array  $where
@param   string $glue
@return  $this
Create WHERE clause