目前使用slimphp做准备语句。当我的查询是
select * FROM doctor
但是,一旦我换成
select * FROM doctor d, user u where d.doctor_nric=u.doctor_nric;
系统将返回null。我已经试过mysql了,它工作正常。知道我的代码哪部分出错了吗?
public function getAllDoctor()
{
$stmt = $this->con->prepare("select * FROM doctor d, user u where d.doctor_nric=u.doctor_nric;");
$stmt ->execute();
$stmt->store_result();
$stmt ->bind_result($doctor_nric,$doctor_name,$doctor_contact);
$doctors = array();
while($stmt->fetch())
{
$data= array();
$data['nric']=$doctor_nric;
$data['name']=$doctor_name;
$data['contact']=$doctor_contact;
$data['user_id']=$doctor_id;
array_push($doctors,$data);
}
return $doctors;
}
暂无答案!
目前还没有任何答案,快来回答吧!