dimanche 2 décembre 2018

laravel leftJoin table from 2 field

How can i select leftJoin table info in different field?

Table Food:

id name category other-category

1 Apple 1 2

Table Category:

id name

1 Plantae

2 Rosids

->leftJoin('Category', 'Food.category', '=', 'Category.id')
->leftJoin('Category', 'Food.other-category', '=', 'Category.id')

But i got error Not unique table/alias:

Here i want is Food.name, category.name, other-category.name



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

Aucun commentaire:

Enregistrer un commentaire