WordPress.org

Ready to get started?Download WordPress

Forums

Mysql related cats problem on upgrade (3 posts)

  1. flakkito
    Member
    Posted 10 years ago #

    Hi - I am having trouble with creating parent cats since the most recent nightly.
    I can add subcats to parent directories but not create new ones.
    I'm now doing it with phpmyadmin by creating a subcat and manually changing the parent ID.
    the error i got when doing it the way its supposed to work was:
    SQL/DB 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]
    INSERT INTO wp_categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', 'Design', 'design', '', )
    the error on upgrading to nightly was:
    [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 'http://developer.apple.com/documentation/macos8/TextIntlSvcs/Te]
    INSERT INTO wp_options (option_id, option_name, option_type, option_value, option_description, option_admin_level) VALUES (93, 'blog_charset', 3, 'utf-8', 'Your blog’s charset (here’s a list of possible charsets)', 8)]
    So i'm wondering if it's a problem here, in my wp-admin/upgrade-functions.php:
    [// Add blog_charset option
    if(!$wpdb->get_var("SELECT * FROM $tableoptions WHERE option_id = '93'")) {
    $wpdb->query("INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level) VALUES (93, 'blog_charset', 3, 'utf-8', 'Your blog’s charset (here’s a list of possible charsets)', 8)");]
    I'm not great at php or mysql but am willing to get my hands dirty if someone can give me feedback.
    Is this something I can/should fix and if so, a pointer in the right direction would be appreciated!
    thanks
    :)

  2. goborobo
    Member
    Posted 10 years ago #

    I don't think the problem is unique to the nightly upgrade. I had this problem when I installed WP about two weeks ago. I ignored it and the installation continued without any obvious problems.
    In the first error you mention I notice that mySQL generates the error at ')' - the end of the value list. It appears that there are 5 values for this table while only 4 are given. I don't have the db structure up in front of me, but if the 4th or 5th field is set to NOT NULL, this might cause the error. You could try putting a 5th value into the statement.
    In the second case, first check that the field names used in the upgrade-functions.php statement correspond to the fields in the corresponding table, and second that the values in the list conform to the specified datatype.

  3. flakkito
    Member
    Posted 10 years ago #

    Thanks for the input, I appreciate it. I get concerned when I get errors. So far everything functions from the users perspective, so i'll wait and see!
    :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.