Support » Plugin: Yasr - Yet Another Stars Rating » MySQLi error during installation

  • Hi,
    during my very first installation I have this fatal error on my WP 4.9.8.

    Fatal error: Uncaught mysqli_sql_exception: 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 ‘IF’ at line 1 in /wp-includes/wp-db.php:1924

    Stack trace:
    #0 /wp-includes/wp-db.php(1924): mysqli_query(Object(mysqli), ‘DESCRIBE IF;’)
    #1 /wp-includes/wp-db.php(1813): wpdb->_do_query(‘DESCRIBE IF;’)
    #2 /wp-includes/wp-db.php(2488): wpdb->query(‘DESCRIBE IF;’)
    #3 /wp-admin/includes/upgrade.php(2251): wpdb->get_results(‘DESCRIBE IF;’)
    #4 /wp-content/plugins/yet-another-stars-rating/lib/yasr-db-functions.php(77): dbDelta(Array)
    #5 /wp-content/plugins/yet-another-stars-rating/yet-another-stars-rating.php(212): yasr_install()
    #6 /wp-includes/class-wp-hook.php(286): yasr_on_activation(”)
    #7 /wp-includes/class-wp-hook.php(310): W in /wp-includes/wp-db.php on line 1924

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dudo


    So strange, I’ve never heard about this error before: Does the tables have been written into the db?

    Hi dudo,
    probably I’ve found a first issue.
    During creation of db tables you invoked dbDelta.
    Using dbDelta() cause a regex to be applied by WP.
    The regex search the table name just after “CREATE TABLE” but in your code there is “IF NOT EXISTS” clause.
    So WP search with the DESCRIBE command some info about a “IF” table!

    At the moment I’ve solved by creating table manually.

    Is this related to 4.9.8 WP version?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘MySQLi error during installation’ is closed to new replies.