vendredi 11 septembre 2020

am not able to get data from two tables

I want to use Laravel to get multiple data from two tables.

i want to get each transaction from two tables where the meterno match with the second table

this is meterandcardno table enter image description here

this is the todo table enter image description here

so i want to get it for each row ...so for example row one will contain the data from first table with its complete data from the second table

i have tried like the following and it didnt work..pls help

$cards = Orders::leftJoin('todos', 'meterorcardno.user_id', '=', 'todos.user_id')
                ->select('meterorcardno.*', 'todos.*')
                ->where('todos.meterno', 'meterorcardno.meterno')
                ->get();
            


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire