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;
    }