lundi 13 septembre 2021

I get the same row duplicated as the result when I do a simple join using the laravel's DB facade

Code

$result = DB::table('disaster_rescue_data')
    ->join('users', 'disaster_rescue_data.username', '=', 'users.email')
    ->get();

Problem

I have this very simple join as mentioned in the above code. However when I render the data on a view or dd the $result, I get the same row duplicated and I can not figure out why. (The rows contain the same data.)

(I am using Laravel 5.4)

Can someone please help me figure out why? (I tried different techniques and none of them worked! Thanks.)



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3nsU3xW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire