I disabled all the other plugins, and I also tried taking every db call off the page except one and i’m still getting a db error. so it has to be something with event calendar 3 being used on the index page.
the newest event calendar 3 candidate release is bad. problem solved.
Sorry that the title of this is incorrect. It should be WordPress eventcalendar3 db error.
So check it out:
http://dev.perspectivescs.org/
Works fine. Then you go to search results:
http://dev.perspectivescs.org/?s=another
and the errors are back. I’ve tried everything, even copying over the code so the two pages, index.php and search.php, are identical. and I still get these errors. This is related to the eventcalendar3 plugin. maybe the s in the string is the culprit? I have no idea but I’m pulling my hair out.
Ok so here’s the error:
WordPress database error: [Column 'category_id' in where clause is ambiguous]
SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) LEFT JOIN wp_post2cat ec3_post2cat ON ec3_post2cat.post_id=id LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id AND ec3_sch.end>='2006-11-08 00:00:00' WHERE 1=1 AND (category_id = 3) AND post_date_gmt <= '2006-11-08 16:42:59' AND ((post_status = "static" or post_status = "publish") OR post_author = 1 AND post_status != 'draft' AND post_status != 'static') AND post_status != "attachment" AND (ec3_sch.post_id IS NOT NULL OR ec3_post2cat.category_id!=5) GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10
So the db request is including these:
ec3_post2cat ON ec3_post2cat.post_id=id LEFT JOIN wp_ec3_schedule ec3_sch ON ec3_sch.post_id=id AND ec3_sch.end>='2006-11-08 00:00:00
(ec3_sch.post_id IS NOT NULL OR ec3_post2cat.category_id!=5)
and I don’t kno why it’s trying to include event calendar 3 (ec3) calls in there because these don’t pertain to the calendar at all.
ok guys, here’s what I’m going to do: In the case of the search results, I’m just going to hard query and pull the results. i’m trying to do that and I’m getting an error that says ‘unexpected T_STATIC’.
here’s the query:
SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE 1=1 AND (category_id = 3) AND ((post_status = "static" or post_status = "publish") OR post_author = 1 AND post_status != 'draft' AND post_status != 'static') AND post_status != "attachment" GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10
So is there too much in this query? all I want to do is pull my posts based on a certain category. What can I do here?