SELECT t2.`col1`, t3.`title`, t3.`col3`, t4.`published` FROM t1 LEFT JOIN t2 ON (t2.`catid`=t1.`id`) LEFT JOIN t3 ON (t3.`id`=t2.`sid`) CROSS JOIN `main_data` t4 ON (t4.`id`=t2.`sid`) WHERE t2.`catid`='7' AND t4.`published`=1 GROUP BY `sid` ORDER BY t3.`title`;

What this does is to show all the titles under catid ("Category ID") that is published.

0 = not publish
1 = publish

The problem is, even if the `published` column is 0, it will still show the title.

I tried to do the reverse, `published`=0, and it will still show everything instead of just showing the unpublished titles.

I'm using MySQL 4.1.12 under Windows XP.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to