[EventCalendar] query_posts for category generates error "'category_id' in where clause is ambiguous"

Jake McMurchie jake.mcmurchie at googlemail.com
Thu Oct 19 16:33:29 UTC 2006


Hi.

I've just upgraded from 3.0.4 to 3.1_rc2 on WP 2.0.4.

I've a couple of custom queries in the same page that use query_posts
to pull posts
from a particular category e.g.:
      query_posts('cat=4');

These now generate the following error:
[Column: 'category_id' in where clause is ambiguous]
SELECT DISTINCT * FROM leftbank_posts LEFT JOIN leftbank_post2cat ON
(leftbank_posts.ID = leftbank_post2cat.post_id) LEFT JOIN
leftbank_post2cat ec3_post2cat ON ec3_post2cat.post_id=id WHERE 1=1
AND (category_id = 2 OR category_id = 5 OR category_id = 6) AND
post_date_gmt <= '2006-10-19 16:29:59' AND (post_status = "publish" OR
post_author = 1 AND post_status != 'draft' AND post_status !=
'static') AND post_status != "attachment" GROUP BY leftbank_posts.ID
ORDER BY post_date desc LIMIT 0, 10

Any suggestions? Please help!

Thanks in advance and thanks for a great plugin.

Jake



More information about the EventCalendar mailing list