Reputation: 35
i'm fairly new to mysql/php and i', trying to grab data from 2 tables:
what I am trying to do is link the tables and echo the results so it comes as table with two columns: organization Name
and organization Department Name
Thanks for any help!
Upvotes: 0
Views: 418
Reputation: 1559
The "JOIN" tag on your question is actually the right key word.
SELECT
org.orgname,
dep.depname
FROM
organization_dep dep
INNER JOIN organization org
ON dep.orgid = org.id
Read more about joining tables in the MySQL Documentation.
Upvotes: 2