How to use with JOIN in SQL?
Closed this issue · 1 comments
superthin commented
I cannot use with LEFT JOIN.
The SQL: $db->getPdo()->query("SELECT users.user_id, users.pw, employee.phone, employee.email FROM users LEFT JOIN employee ON users.user_id = employee.em_id WHERE employee.phone = :phone OR employee.email = :email", [':phone' => $usrname, ':email' => $usrname])->fetch()
Error: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'phone' in 'where clause' in
mucahidbaris commented
working to join method please check it