WordPress.org

Ready to get started?Download WordPress

Forums

MySQL error after upgrade to 2.1 (18 posts)

  1. benbt-japan
    Member
    Posted 7 years ago #

    My host has WordPress available for automatic install/upgrade. I used their upgrade service (after backing some things up myself just in case) and everything seems to have gone smoothly, apart from this error which displays in the sidebar, under the archives list, where all my links should be (they don't display):

    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 'ASC' at line 1]
    SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_id- ASC

    I am using the veryplaintxt theme.
    The error occurred before I had activated any plugins so it can't be due to that, I think.

    My post categories display properly in the sidebar, but none of the links, nor their categories, show up.

    http://www.language-global.com/blog

  2. sofsoldier
    Member
    Posted 7 years ago #

    I have a similar problem - received link errors when I upgraded from 2.07 to 2.1. My Link category is no longer available and I cannot add any links to the blog (that is, its in the blog roll but not on the site), when I do I get an error:

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_link2cat WHERE link_id = 1 ORDER BY category_id

    When I edit the bookmark I just added, there is an error listed in the Category box:

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = '1'

    Would deleting my link categories fix this problem? And if so, how do I do that exactly? I am running WP version 2.1, PHP 5.2 and MySQL 4.1.22. I have no idea how to use a phpMyAdmin type program but this is on my own server so I have access to the MySQL command prompt.

  3. benbt-japan
    Member
    Posted 7 years ago #

    Yes, it would be useful to know if deleting all the links and link categories and re-entering them in 2.1 would solve the problem.

    It seems like link categories and post categories are no longer differentiated from each other.

    Also, I have a page which seems to have been added to a post category as a post, not a page.

    As above : http://www.language-global.com/blog

  4. sofsoldier
    Member
    Posted 7 years ago #

  5. benbt-japan
    Member
    Posted 7 years ago #

    That solution is not practical for me as I do not run my own server.

    Is there any way to get the link categories and the links to display in the sidebar as before, without having to roll-back (my provider will do the rollback for me, but I have to pay for the service)?

  6. benbt-japan
    Member
    Posted 7 years ago #

    re: rollback : I have seen posts on this board about people even having errors after rolling back. So I feel like I'm stuck with a buggy wordpress and can't do anything about it.

    :(

  7. benbt-japan
    Member
    Posted 7 years ago #

    Looking at the error message again, I think I may have hit on something:::

    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 'ASC' at line 1]
    SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_id- ASC

    Surely the ORDER BY cat_id- ASC should be ORDER BY cat_id ASC ??

  8. RayWITW
    Member
    Posted 7 years ago #

    My error is similar. I also have no access to the database, as I am hosted on Lunarpages. Here it is:

    [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 cat_id, cat_name FROM

  9. ccf
    Member
    Posted 7 years ago #

    All the links in my blogroll are gone and I get this message in the sidebar

    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 cat_id,cat_name FROM

    Why did I have to fix something that worked fine? I can't even go back to 2.07, I have tried, and it doesn't work
    Please help!!!!

    http://blogginginparis.com

  10. Samuel B
    moderator
    Posted 7 years ago #

    Most of these type errors are from themes not updated for 2.1. Check your theme author's website to see if he/she has an update.

  11. ccf
    Member
    Posted 7 years ago #

    I can't change the theme. What I would like to do is go back to 2.07 which was OK for me. Could you tell me how to do that?
    Someone helped me with this theme a long time ago. I wouldn't know how to change it and haven't got a clue how to change it so that it adapts to 2.1
    What you are telling me is I can't ever recover my links unless I change the theme.
    I like my theme and don't really want to change it.
    Why, oh why did I upgrade?

  12. ccf
    Member
    Posted 7 years ago #

    eija, here suggested a fix that worked.

  13. benbt-japan
    Member
    Posted 7 years ago #

    After the panic, I managed to fix the problem on my site with the link categories and links not displaying.

    I edited category.php in wp_includes to correct the query. The error message was enough to track down the right place and then it was a question of just adding an
    if ($xxx='id-') { $xxx='ID'; }
    to correct the variable containing the typo.

    After that everything works as it probably should.

  14. pgmccullough
    Member
    Posted 7 years ago #

    I am having the exact same problem. Benbt-japan - could you elaborate on exactly where to stick:

    if ($xxx='id-') { $xxx='ID'; }

    Thanks so much.

  15. driveafastercar
    Member
    Posted 7 years ago #

    Ditto - where in category.php did you put that code? I'm getting the exact same error you did in the exact same theme.

  16. moshu
    Member
    Posted 7 years ago #

    I think instead of editing core files (always a bad omen) you should update your theme files!
    Most likely the template file displaying your links (sidebar.php?) is using a deprecated template tag; see:
    http://codex.wordpress.org/Template_Tags#Links_Manager_tags

    or, due to the changes in the database, the template tags are pointing to the wrong link category ID#.

  17. driveafastercar
    Member
    Posted 7 years ago #

    PERFECT! Before the link code was <?php get_links_list('id-'); ?>. All I had to do was change it to <?php get_links_list('id'); ?> and it was fixed! All that for a little '-'! Thank you!

    (This was in the veryplaintxt theme post-upgrade, fyi.)

  18. thekaran
    Member
    Posted 7 years ago #

    Yes, i had the exact same problem. I was using a modified version of veryplaintxt theme.

    Go to sidebar.php file in Theme editor and replace <?php get_links_list('id-'); ?> with <?php get_links_list('id'); ?>

    It works great now. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags