src/Mysqli.php
public function value($field)
    {
        if (!$this->table) {
            throw new Exception('请选择数据表');
        }

        $this->limit(1);

        $this->field($field);

        $this->_sql = 'SELECT ' . $this->field . ' FROM ' . $this->table;

        empty($this->join) ?: $this->_sql .= $this->join;
        empty($this->where) ?: $this->_sql .= $this->where;
        empty($this->group) ?: $this->_sql .= $this->group;
        empty($this->having) ?: $this->_sql .= $this->having;
        empty($this->order) ?: $this->_sql .= $this->order;
        empty($this->limit) ?: $this->_sql .= $this->limit;

        $result = $this->query();
        if (!$result) {
            throw new Exception('查询sql错误:' . $this->_sql);
        }

        //获取记录条数
        $this->total = mysqli_num_rows($result);
        if ($this->total == 0) {return false;}

        while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
            $this->field = str_replace('`', '', $this->field);

            $data = $row[0];
        }

        if (empty($data)) {
            return false;
        }

        return $data;
    }
public function value($field)
    {
        if (!$this->table) {
            throw new Exception('请选择数据表');
        }

        $this->limit(1);

        $this->field($field);

        $this->_sql = 'SELECT ' . $this->field . ' FROM ' . $this->table;

        empty($this->join) ?: $this->_sql .= $this->join;
        empty($this->where) ?: $this->_sql .= $this->where;
        empty($this->group) ?: $this->_sql .= $this->group;
        empty($this->having) ?: $this->_sql .= $this->having;
        empty($this->order) ?: $this->_sql .= $this->order;
        empty($this->limit) ?: $this->_sql .= $this->limit;

        $result = $this->query();
        if (!$result) {
            throw new Exception('查询sql错误:' . $this->_sql);
        }

        //获取记录条数
        $this->total = mysqli_num_rows($result);
        if ($this->total == 0) {return false;}

        while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
            $this->field = str_replace('`', '', $this->field);

            $data = $row[0];
        }

        if (empty($data)) {
            return false;
        }

        return $data;
    }
获取单个字段内容
@date   2018-04-06T21:35:17+0800
@author ChenMingjiang
@param  [type]                   $field [description]
@return [type]                          [description]