Skip to content
Advertisement

Integrity constraint violation: 1052

Integrity constraint violation: 1052 Column ‘id’ in where clause is ambiguous (SQL: select * from kumeti_member_registrations left join members list on members list.id = kumeti_member registrations.member_name where id = 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();
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement