need to create output from more than one table using join

Need to create output from more than one table using join and wildcards..on the sql call
the sql statement works on the first table but cannot figure out the join...the third table
populates the emp_code_type of the second table.; at least thats the plan.

first table:accounts table:
account_id
account_name
physical_address
city
stat_prov
country
zip


second table:employees_table
account_uid
active_site_uid
emp_uid
emp_code_type
emp_name
emp_address
emp_city
emp_frequency
emp_hours_of_cleaning

third table:emps_code_type
emp_type_uid
emp_type_description

right now it working ok for the information for the first table but not sure how to join to the
second table.... attached is the two php files which do the calls...


clientspecs.php
results3.php
solunatecAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

YZlatCommented:
try something like this:

SELECT a.account_name,
a.physical_address,
a.city,
a.stat_prov,
a.country,
a.zip,
e.emp_name,
e.emp_address,
e.emp_city,
e.emp_frequency,
e.emp_hours_of_cleaning,
et.emp_type_description
FROM accounts as a
INNER JOIN employees_table as e ON a.account_id=e.account_uid
INNER JOIN emps_code_type as et ON e.emp_code_type=et.emp_type_uid
WHERE somefield LIKE '%TEST%%'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Beverley PortlockCommented:
Something along these lines

SELECT * FROM accounts
    INNER JOIN employees_table ON account_id = account_uid
    INNER JOIN emps_code_type ON emp_code_type = emp_type_uid

I'm not sure if I have picked the correct JOIN fields. Change them if not. Also I am assuming that there is always a record in all three tables. If there can be a record missing in some tables then use LEFT JOIN rather than INNER JOIN
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.