I looked at the similar questions and answers but not seemed to help.
I have a query:
$stmt = $conn->prepare(
'SELECT kpp_id FROM kpp_profile WHERE email = :email AND password = :password
UNION ALL
SELECT pm_id FROM pm_profile WHERE email = :email AND password = :password
UNION ALL
SELECT trainer_id FROM trainer_profile WHERE email = :email AND password = :password');
$stmt->execute( array( ':email' => $email, ':password' => $password ) );
$result = $stmt->fetchAll();
For some reason this only returns results for the first query. Can anyone help me understand why?