Jorge
Jorge

Reputation: 5676

PHP MySQL join table

$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?

Upvotes: 0

Views: 1907

Answers (1)

amphetamachine
amphetamachine

Reputation: 30651

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);

Upvotes: 2

Related Questions