我在codeIgnitor中执行MYSQL查询时为php,$this->db->get()
给出空结果,当我直接在phpmyadmin
运行时,它会给出结果,为什么会这样?
的phpmyadmin:
CodeQuery:
$this->db->select('courses.id AS courseId',false);
$this->db->select('courses.Name AS courseName',false);
$this->db->select("`assignments`.`Assignment#` AS assignmentName",false);
$this->db->select('assignments.DueDate AS duedate',false);
$this->db->select('assignments.DueTime AS duetime',false);
$this->db->select('assignments.expiryDate AS expiryDate',false);
$this->db->from('courses,user,assignments,course2teacher,follows');
$this->db->where('user.id',$studentid);
$this->db->where('follows.studentid=user.id');
$this->db->where('follows.course2teacherid=course2teacher.id');
$this->db->where('assignments.course2teacherid=course2teacher.id');
$this->db->where('course2teacher.CourseId=courses.id');
$query = $this->db->get();
print_r($query); die();
输出代码查询是NULL
,有人可以解释一下这里发生了什么,我该如何解决?
修改
我的数据库结构已开启:http://ondras.zarovi.cz/sql/demo/
只需转到链接,点击save/load
点击load
,点击isec
点击ok
,现在是第二天正在努力解决单一查询问题