• Hi,

    The following error occurred with both events-manager 5.0.50 and 5.0.51:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT event_id FROM wp_em_events WHERE event_id=

    This does not happen when updating existing events. The last successful event posting was on January 10. It would have been done using the most recent version of event-manager available at that time.

    Does anyone know if this is a bug or a conflict with another plugin? To me, it appears that the query wants to use an event_id that should have been generated by an INSERT query and that no such id is available.

    Suggestions?

    Thanks,
    Jen

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Like what you said, it could be a plugin conflict or a theme issue; You can try to deactivate other plugins or revert to default theme. Also, can you provide more details such as installed plugin, theme or if its in multisite mode.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    is this when you create a new event?

    Thread Starter halifaxious

    (@halifaxious)

    Hi Marcus,

    Yes, it only happens when I try to create a new event. Both the ‘save draft’ and the ‘Publish’ buttons will cause it.

    Site details:
    Theme: Suffusion with child theme
    multisite: NO
    WP version: 3.3.1

    Cheers,
    Jen

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Not sure what’d cause this. I’d try disabling your plugins and use the 2011 theme to see if any of these are causing it.

    Thread Starter halifaxious

    (@halifaxious)

    I disabled all plugins except Event Manager and tried the 2011 theme. The problem still occurs.

    One thing I did notice, is that all the test events I’ve been creating actually do end up in the Events list (both admin and on the calendar). So the SQL error is more alarming than harmful.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    could be, but would be nice to avoid it….

    Is WP_DEBUG on for you in wp-config.php (you should turn it off if you’re on a production site)? I tried creating an event with it enabled and didn’t duplicate this.

    Thread Starter halifaxious

    (@halifaxious)

    I’d forgotten I had WP_DEBUG==true. Turning it off does fix the immediate issue in an ‘out of sight, out of mind’ sort of way.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    I usually develop with WP_DEBUG on, so usually this doesn’t happen… If we can find the pattern as to why it happens it would probably be an easy fix.

    webdsgndotme

    (@webdsgndotme)

    Try patching events-manager/classes/em-event.php with the folling:

    583c583,587
    < 			$event_truly_exists = $wpdb->get_var('SELECT event_id FROM '.EM_EVENTS_TABLE." WHERE event_id={$this->event_id}") == $this->event_id;
    ---
    >       if (empty($this->event_id)) {
    >         $event_truly_exists = false;
    >       } else {
    >         $event_truly_exists = $wpdb->get_var('SELECT event_id FROM '.EM_EVENTS_TABLE." WHERE event_id={$this->event_id}") == $this->event_id;
    >       }

    The error is raising when the event_id property of the EM_Event object is empty, and so the query fails.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    agreed, thx for fix

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Events Manager] SQL error on event-save’ is closed to new replies.