dcblogdev/pdo-wrapper

How to use with JOIN in SQL?

Closed this issue · 1 comments

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

working to join method please check it