related tables

related tables

Diego1966Diego1966 Posts: 20Questions: 4Answers: 0

Good morning everyone.
I am relatively new to working with DataTables and I'm seeking assistance on implementing a parent-child relationship in DataTables using PHP on the server-side.

Here's a brief overview of my scenario:

I have two tables: "employees" with columns ID (PK) and details of employees, and "mybadge" with columns ID (PK), employee_ID (FK), and the badges that have been issued
I want to display the names and details of employees in the parent table and the assignments badge and details in the child table.
I am confused about how to structure the SQL query to fetch data from both tables efficiently, considering the relationship between them, especially because I don't work with the DataTables editor, and I don't know if what I would like to do can be achieved without the editor.
I have read through the discussions you mentioned ("https://datatables.net/forums/discussion/59338/join-an-mjoin" and "https://datatables.net/blog/2019/parent-child-editing-in-child-rows"), and I find them helpful. However, I still need clarification on implementing the query in PHP for my specific scenario.

I have also attached a snapshot of my data model for better understanding.

Thank you for your assistance.

Best regards,
Diego

Replies

Sign In or Register to comment.