Home  >  Q&A  >  body text

Teacher, what is the reason for this problem?

Fatal error: Call to a member function select() on a non-object in F:\Work Space\Site\php\video\extend\Util\data\Sysdb.php on line 34

[1] ErrorException in Sysdb.php line 34

Call to a member function select() on a non-object

//这里

//返回一条记录 public function item(){

$item=Db::name($this->table)->field($this->field)->where($this->where)->find();

return $item ? $item : false ;

 }

//返回多条记录

public function lists(){

$query = Db::name($this->table)->field($this->field)->where($this->where)->select(); $this->order && $query = $query->order($this->order); $lists = $query->select(); return $lists ? $lists : false; } //自定义索引列表******************************************* public function cates($index){ $query = Db::name($this->table)->field($this->field)->where($this->where)->select(); $this->order && $query = $query->order($this->order); $lists = $query->select(); /*dump($lists); exit();*/


永远的菜鸟永远的菜鸟2309 days ago1484

reply all(1)I'll reply

  • 无忌哥哥

    无忌哥哥2018-07-18 09:18:44

    See if the select on line 34 returns any data.

    reply
    0
  • Cancelreply