Integrity constraint violation: 1052 Column ‘id’ in where clause is ambiguous (SQL: select * from
kumeti_member_registrations
left joinmembers list
onmembers list
.id
=kumeti_member registrations
.member_name
whereid
= 2)”,
this Query please solve the error
$result = DB::table('kumeti_member_registrations') ->leftjoin('members_list', 'members_list.id', '=', 'kumeti_member_registrations.member_name') ->where('id', $id) ->get();
Advertisement
Answer
Try this:
$result = DB::table('kumeti_member_registrations') ->leftjoin('members_list', 'members_list.id', '=', 'kumeti_member_registrations.member_name') ->where('kumeti_member_registrations.id', $id) ->get();