SELECT a.* FROM table_a a LEFT JOIN table_b b ON b.lid=a.lid WHERE a.published > 0 AND a.published <= 1118827824 AND (a.expired = 0 OR a.expired > 1118827824) AND a.offline = 0 AND b.cid=a.cid OR (a.cid=1 OR b.cid=1) ORDER BY published DESC
I am having problems getting this query to work correctly, while the actually join seems to work, for some reason it ignores this part of the query and displays published, expired or online regardless of what is actually stored in these fields:
Catzwolf wrote:SELECT a.* FROM table_a a LEFT JOIN table_b b ON b.lid=a.lid WHERE a.published > 0 AND a.published <= 1118827824 AND (a.expired = 0 OR a.expired > 1118827824) AND a.offline = 0 AND b.cid=a.cid OR (a.cid=1 OR b.cid=1) ORDER BY published DESC
I am having problems getting this query to work correctly, while the actually join seems to work, for some reason it ignores this part of the query and displays published, expired or online regardless of what is actually stored in these fields:
WHERE a.published > 0 AND a.published <= 1118827824 AND (a.expired = 0 OR a.expired > 1118827824) AND a.offline = 0
SELECT a.* FROM table_a a LEFT JOIN table_b b ON b.lid = a.lid
WHERE a.published > 0 AND a.published <= 1118834480
AND (a.expired = 0 OR a.expired > 1118834480)
AND a.offline = 0
AND (b.cid=a.cid OR (a.cid=1 OR b.cid=1))
ORDER BY published DESC