0
$sql = "SELECT logs.full_name, logout.status FROM logs, logout WHERE logs.employee_id = logout.employee_id";
tables --> logs
           logout

I'm having error on this. I search join tables in google. And that's what I got. What is wrong with this code?

0

1 Answer 1

2

I don't see a "JOIN" anywhere in your query.

The correct syntax:

SELECT logs.full_name, logout.status FROM logs
    LEFT JOIN logout ON (logs.employee_id = logout.employee_id);
Sign up to request clarification or add additional context in comments.

2 Comments

Your answer is correct but the results are only from logout table. I wanted to have a result that coming from the two tables.
Oh. I think thats not join tables. I found an answer using UNION. Thanks a lot in your answer. It helps me a lot. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.