select e.name, age
from emp e, works w
Sorry, no idea what "(w.did or w.did)" could possibly mean. You need a condition for boolean resolution, e.g. "w.did=1". In any case, if w.did was actually a boolean somehow, the statement would alway be true.
I'd recommend writing some queries against the database before using them in PHP. That way, you'll get some debug feedback.
This post has been edited by baavgai: 03 December 2008 - 05:39 AM