I don't know what may be wrong with my query, but I have been rubbing my head hard for the past few hours. Maybe somebody may be of help by pointing what's wrong out for me.
I am trying to fetch matching members from table one and join on table two with multiple conditions from both tables with the query below, but it keeps on returning empty fields or say rows, even when I am so sure that there are matches:
SELECT s.name, s.gender, s.level, s.program, s.registered
     , s.available, s.dispic, c.staff, c.level, c.year, c.period
FROM students s
LEFT JOIN allots c ON s.level=c.level AND s.registered=1 AND s.available=0
WHERE c.staff=:staff
  AND c.year=:year
  AND c.period=:period
  AND c.level=:level
  AND c.subject:subject
ORDER BY s.name DESC;
All effort have proved faulty.
