[EventCalendar] 3.0.4 iCal DB corruption?

Darrell Schulte d at schulte.mn
Thu Oct 12 13:45:12 UTC 2006


On Oct 12, 2006, at 8:25 AM, Jim Galley wrote:

>> I think it's a problem that happens when you use MySQL 5. Are the two
> databases running different versions of MySQL?
>
> Yes - new is running MySQL 5.0.19
>
>
>> The 3.1 equivalent of this code is...
>>
>>      FROM $wpdb->posts p
>>      LEFT  JOIN $wpdb->users   u ON p.post_author=u.ID
>>      INNER JOIN $ec3->schedule s ON p.id=s.post_id
>>
>> So, try that for me. Replace everything from 'FROM' with...
>>
>>      FROM $wpdb->posts p,
>>     LEFT  JOIN $wpdb->users    u   ON p.post_author=u.ID
>>     INNER JOIN $wpdb->post2cat p2c ON p.id=p2c.post_id
>>       AND p2c.category_id=$ec3->event_category
>
> ok... I'll declare my noob status - where can I find this code
> snippet?  I searched in eventcalendar3.php and couldn't find it.

Been a while since I looked at 3.0.4...look for line 1157.

    $calendar_entries = $wpdb->get_results(
       "SELECT
            p.id as id,
            post_title,
            post_excerpt,
            DATE_FORMAT(post_date_gmt,'%Y%m%dT%H%i%sZ') as dt_start,
            $user_nicename
          FROM $tableposts p, $tablepost2cat p2c
          LEFT JOIN $tableusers u
            ON u.ID=p.post_author
          WHERE post_status = 'publish'
            AND p.id = post_id
            AND category_id = $ec3->event_category"
     );

I think Alex wants you to change the query to:

    $calendar_entries = $wpdb->get_results(
       "SELECT
            p.id as id,
            post_title,
            post_excerpt,
            DATE_FORMAT(post_date_gmt,'%Y%m%dT%H%i%sZ') as dt_start,
            $user_nicename
          FROM $wpdb->posts p,
          LEFT  JOIN $wpdb->users u ON p.post_author=u.ID
          INNER JOIN $wpdb->post2cat p2c ON p.id=p2c.post_id
            AND p2c.category_id=$ec3->event_category"
     );


Hopefully I interpreted the Alex's request correctly.


Darrell

Darrell Schulte
http://schulte.mn





More information about the EventCalendar mailing list