Display name with corresponding id on table
Display name with corresponding id on table

Hi all,
I would like to display the name of someone on table2. The data is organized as below:
table1: person
id
firstName
lastName
...
table2: bookings
booking_id
person_id <-- same as person.id, same person_id can present multiple times in table2
...
I would like to display the firstName and lastName on the datatable when viewing table2.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You should do a leftJoin
https://editor.datatables.net/manual/php/joins#leftJoin-method
@rf1234
Thanks, leftJoin works for me