$this->db->select('u.name, u.file', false);
$this->db->from('users_domains as u');
$this->db->where("EXISTS('domain as d', 'd.id = u.domain_id')");
$query = $this->db->get();
错误编号:1064您的SQL语法错误;检查与您的MySQL服务器版本相对应的手册以获取正确的语法,以在第3行的'domain as d','d.id = u.domain_id')'附近使用SELECT u.name,u.file FROM users_domains as u存在的地方('domain as d','d.id = u.domain_id')文件名:C:/xampp/htdocs/codeminiproject/system/database/DB_driver.php行号:691
答案 0 :(得分:0)
where
必须为join
$this->db->join('domain as d', 'd.id = u.domain_id','inner');
$query = $this->db->get();
$result = $query->result();
现在随时随地使用HTML $result
如果此代码在任何函数中,并且您想通过该函数返回数据,请执行以下操作:-
return $query->result(); // instead of $result = $query->result();