I need to give my client the option to publish some posts with same name in different categories. the CMS is closed and I can’t add anymore fields…
There is a spare field which I can use to identify posts as identical, but I don’t won’t a situation where to exact posts will load (posts in my case are images).
So I figured my client can specify identical “field” for all identical posts.
The problem is that the default for the field is null. if i’ll use distinct, only one result will come from all the non-identical posts (all of them by default = null)…
Is there a way to select distinct “field” if not null?
I tried looking and trial and error with the above but it didn’t work for me…
The query itself is quite simple…
SELECT id,introtext,publish_up,publish_down
from #__content
WHERE catid IN(936,937,940,959,972,988,991) AND state = 1
AND ( publish_up = "0000-00-00 00:00:00" OR publish_up <= "2011-10-30 12:12:59" )
AND ( publish_down = "0000-00-00 00:00:00" OR publish_down >= "2011-10-30 12:12:59" )
--removed duplicated query
Will appreciate any clue or directions…
Thanks!
Yanipan
Which field is by default NULL? I’ll just name it X and you can change it accordingly:
I hope I got it right!