[EventCalendar] database error message

Isaac Hunter Dunlap IH-Dunlap at wiu.edu
Tue Oct 17 04:44:46 UTC 2006


Darrell,

Thanks for your response. Inserting the suggested replacement code (into 
template-functions.php @ lines 130-143),
produced the following (somewhat different) error message (would be 
interested to learn if Keith and Brian also get the same results)...
--Isaac

http://www.wiu.edu/library/units/infosys/wp_dev2/ :
*WordPress database error:* [You have an error in your SQL syntax near 
'UNION SELECT DISTINCT id, post_title, post_date' at line 12]| SELECT 
DISTINCT id, post_title, GREATEST(start,'2006-10-01 00:00:00') AS 
start_date, LEAST(end,'2006-11-01 00:00:00') AS end_date, allday, 1 AS 
is_event FROM wpdev2_posts,wpdev2_ec3_schedule WHERE 
post_status='publish' AND post_id=id AND end>='2006-10-01 00:00:00' AND 
start<'2006-11-01 00:00:00' UNION SELECT DISTINCT id, post_title, 
post_date AS start_date, post_date AS end_date, 0 AS allday, 0 AS 
is_event FROM wpdev2_posts WHERE post_status='publish' AND 
post_date>='2006-10-01 00:00:00' AND post_date<'2006-11-01 00:00:00' AND 
post_date<NOW() ORDER BY id, allday DESC, start_date, is_event DESC|


*----------------------------------------------------------------------------------------------------------------
Darrell Schulte* d at schulte.mn 
<mailto:eventcalendar%40firetree.net?Subject=%5BEventCalendar%5D%20Today%27s%20events&In-Reply-To=9ADE954C5044754C8E0BF406B5A217551114C811%40ESCHE.csuchico.edu>
/Tue Oct 17 01:34:22 UTC 2006/
------------------------------------------------------------------------

Keith, Isaac and Brian,

I'm unable to reproduce the error you are experiencing on my local  
development blog, however, taking the query and putting it into  
phpMyAdmin does produce an error.

If I take the UNION parts separately, I receive valid responses from  
MySQL. So, I suppose it could be getting fouled up on those  
parentheses. Try this -- go into template-functions.php and replace  
lines 130-143 with the following.

     $sql=" $sql  UNION
       SELECT DISTINCT
          id,
          post_title,
          post_date AS start_date,
          post_date AS end_date,
          0 AS allday,
          0 AS is_event
        FROM $wpdb->posts
        WHERE post_status='publish'
          AND post_date>='$begin_date'
          AND post_date<'$end_date'
          AND post_date<NOW()
      ";


Give that a try. I could be completely wrong and possibly changing  
the scope of the query, but it might be worth a try...

Darrell Schulte
http://schulte.mn


--------------------------------------------------------------------------------
*Isaac Hunter Dunlap* 
IH - Dunlap at wiu.edu
 <mailto:eventcalendar%40firetree.net?Subject=%5BEventCalendar%5D%20database%20error%20message&In-Reply-To=>/Mon Oct 16 23:41:57 UTC 2006
RE: database error message
/

Hello, Am running: WP 2.0.4 and EventCalendar BETA 3.1._rc2 and a fresh 
download of the Widgets plugin. Using default WP theme and configs (no 
widgets besides EC installed). Everything appears to install OK and is 
activated (tables are created). The calendar appears on the right 
sidebar via Widgets, but after repeated EC installations and even 
complete WP/EC installations, I continue to see database error messages 
appear just above the "October" calendar on the sidebar (see below). Any 
suggestions? Thank you. --Isaac 
http://www.wiu.edu/library/units/infosys/wp_dev2/

WordPress database error: [You have an error in your SQL syntax near '( 
SELECT DISTINCT id, post_title, GREATEST(start,'2006-10-0' at line 1] ( 
SELECT DISTINCT id, post_title, GREATEST(start,'2006-10-01 00:00:00') AS 
start_date, LEAST(end,'2006-11-01 00:00:00') AS end_date, allday, 1 AS 
is_event FROM wpdev2_posts,wpdev2_ec3_schedule WHERE 
post_status='publish' AND post_id=id AND end>='2006-10-01 00:00:00' AND 
start<'2006-11-01 00:00:00' ) UNION ( SELECT DISTINCT id, post_title, 
post_date AS start_date, post_date AS end_date, 0 AS allday, 0 AS 
is_event FROM wpdev2_posts WHERE post_status='publish' AND 
post_date>='2006-10-01 00:00:00' AND post_date<'2006-11-01 00:00:00' AND 
post_date<NOW() ) ORDER BY id, allday DESC, start_date, is_event DESC






More information about the EventCalendar mailing list