I made this code 1 in code 2
1)//$palpites=DB::select("SELECT * FROM palpite WHERE id_u='$id' order by id_c desc ");
2) $palpites = DB::table('palpite')->where('id_u',$id)->orderby('id_c','desc') ->paginate(3);
How to turn this code below into the same example as 1,2?
$confrontos=DB::select("SELECT * FROM confrontos as c, palpite as p WHERE p.id_u ='$id' AND EXISTS (SELECT * FROM palpite WHERE c.id = p.id_c) order by id_c desc ");