【发布时间】:2018-12-15 16:03:30
【问题描述】:
假设我有一些doctor_id的对象数据
{doctor_id: 1}
{doctor_id: 2}
现在我想从doctors 表中找到那些被选中的doctor_id 的名字。
doctors 表字段为id,name,address....
我的查询是
$doctors_data = Doctor::whereIn('id', $doctor_id)->get();
但我从 log 文件中收到错误
local.ERROR: SQLSTATE[HY000]: 一般错误: 2031 (SQL: select * from
doctorswhereidin (?))
对此的查询是什么。请帮忙
【问题讨论】:
-
对象数据,集合吗?
-
@linktoahref...是的...
-
你能显示结果吗
dd($doctor_id);
标签: php mysql sql laravel laravel-5.5