query = SELECT documents.title, jobs.brand FROM documents,jobs,brands WHERE documents.id = jobs.document AND jobs.brand = brands.id AND jobs.active=1 AND (brand = 5 OR brand = 1) ORDER BY jobs.pubDate DESC Column 'brand' in where clause is ambiguous