Wednesday, 2 October 2013

mysql query for select from two mysql tables

mysql query for select from two mysql tables

i'm using codeigniter.
i have two mysql tables.
what i'm doing is taking all the details in the first table and feed it to
html page and let all users to view it. but now i want to take some
details from second table related to a colum in first table.
i mean i have a column in first table call "Pending_on" in that column i
have inserted some branch names. and in the second table i have inserted
the contact details of those departments.
so if we think in the first table fifth row pending_on column has the
value "HR" then i want to display the telephone number of the HR
department.
so how can i write a query for this?

No comments:

Post a Comment