Skip to content
Advertisement

left join query of mysql php

I’m working on a project where i have two tables 1 is the Users table and another one in the Department table. here i have given foreign key connection to department table to the users table and checked that is working fine.(getting data of particular foreign key). now my requirement is in a single table i want to display all users along with that the foreign key value also. here i’m attaching the screenshot of my output.

JavaScript

tried code:

JavaScript

so here is my code. please help me to get the value from the foreign key.in this image i’m getting foreign key id of 1 in the td of department name

Advertisement

Answer

I think you want this result but i don’t know your column name:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement