WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Error on update (wp 3.5 - Relevanssi 3.1) (11 posts)

  1. Rics1983
    Member
    Posted 1 year ago #

    Hi Mikko!
    I was updating to the new version of relevanssi, and although on a website went smoooth, on another i got this error message:

    [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 ''typeitem' ('type', 'item')' at line 1]
    ALTER TABLE tableprefix_relevanssi ADD INDEX 'typeitem' ('type', 'item')

    http://wordpress.org/extend/plugins/relevanssi/

  2. Ruud Laan
    Member
    Posted 1 year ago #

    Hi Mikko, I just got the same error.

    Tried some adjustments to your code:
    $wpdb->query("ALTER TABLE " . $relevanssi_variables['relevanssi_table'] . " ADD INDEX typeitem (type, item);");

    works in MySQL 5.0.51a-3ubuntu5.4

  3. Ruud Laan
    Member
    Posted 1 year ago #

    In relevanssi.php line 114

  4. Frank Staude
    Member
    Posted 1 year ago #

    Hello,

    i have the same error in my error_log after the update.

    [Tue Dec 18 16:44:25 2012] [warn] mod_fcgid: stderr: WordPress-Datenbank-Fehler 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 ''typeitem' ('type', 'item')' at line 1 f\xc3\xbcr Abfrage ALTER TABLE wp_relevanssi ADD INDEX 'typeitem' ('type', 'item') von require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, relevanssi_check_old_data
    [Tue Dec 18 16:45:25 2012] [warn] mod_fcgid: stderr: WordPress-Datenbank-Fehler 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 ''typeitem' ('type', 'item')' at line 1 f\xc3\xbcr Abfrage ALTER TABLE wp_relevanssi ADD INDEX 'typeitem' ('type', 'item') von require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, relevanssi_check_old_data

    Frank

  5. jrf
    Member
    Posted 1 year ago #

    Same issue here, error log flooded.... WP 3.4.2

    @ruud I've made a small improvement on your code, this should work for most MySql versions:

    File relevanssi.php:

    Find line 114 and replace with:

    if ($res == 0) $wpdb->query("ALTER TABLE %%" . $relevanssi_variables['relevanssi_table'] . "%% ADD INDEX %%typeitem%% (%%type%%, %%item%%);");

    ** IMPORTANT UPDATE **
    DARN! The symbol needed in the query is the symbol used in this markdown editor for indicating code... so the line of code will never show properly....

    Anyways, I've changed the symbol to %% in the code example above. Replace this in live code to a backtick "`"

    Hope this will display correctly now...

    Hope this helps!

    Smile,
    Juliette

  6. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. The code as written seemed to work just fine on my site, but looks like it isn't universally ok. I'll do a quick update soon.

  7. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    3.1.1 fixes this.

  8. Rics1983
    Member
    Posted 1 year ago #

    Thank you, i'll check asap.

  9. jrf
    Member
    Posted 1 year ago #

    Thanks!

  10. jrf
    Member
    Posted 1 year ago #

    Strangely enough, I still don't see the fix in the latest version...

    By now it's line 144, file relevanssi.php:


    Update:

    ** code removed**

    Grrrr... backticks still disappearing...

    Mikko, is there another way for me to get the code to you ?

    P.S.: moderators, sorry for not using the code tags, but that would mangle the above code considering it has backticks...

  11. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Use pastebin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic