• Resolved Rics1983

    (@rics1983)


    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/

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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

    In relevanssi.php line 114

    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

    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

    Plugin Author Mikko Saari

    (@msaari)

    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.

    Plugin Author Mikko Saari

    (@msaari)

    3.1.1 fixes this.

    Thread Starter Rics1983

    (@rics1983)

    Thank you, i’ll check asap.

    Thanks!

    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…

    Plugin Author Mikko Saari

    (@msaari)

    Use pastebin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Error on update (wp 3.5 – Relevanssi 3.1)’ is closed to new replies.