• Resolved knowtown

    (@knowtown)


    I was having a lot of problems since upgrading to 2.1 but with the help of a lot of fine people here and the new release of 2.1.1 I have everything working except one thing. It is minor but very annoying and I could not find anything about this in the forum. I am hoping someone here can point me in the right direction.

    When ever I write a post that contains an apostrophe (‘) WordPress generates a database error that reads:

    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 ‘s excerpt that is creating error’ at line 1]
    UPDATE wp_posts SET post_content = ‘The complete text of the post displays here. in this post would be the post’s excerpt that is creating the error.’ WHERE ID = ‘628’

    So any contractions (like, can’t, don’t, I’m, etc) generate the error. The error will come up at the first autosave and keeps generating at each save after that. When I finally publish, the post will publish OK so I don’t think it is anything major but I sure would love to know what is causing it and how to fix it. Any help would be appreciated.

    James

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter knowtown

    (@knowtown)

    I just created a brand new blog in a different subdirectory and I am having the same problem. This was a fresh install. I am wondering if this could be something wrong with my SQL database?? Any one have any ideas on if something in the SQL database could cause the apostrophe problem I am having??

    Thanks for any help.

    James

    Did you use a second “clean” database for the new install? Or put it in the same db with a different prefix?

    Thread Starter knowtown

    (@knowtown)

    vkaryl.

    Thanks for your reply. I put it in a clean database for the new install.

    James

    Well, that leads me to believe it’s maybe one of these possibles:

    1. your host has something “odd” set up with the mysql backend;

    2. there’s something unusual going on with the “collation” that your mysql backend is using in comparison to the character set your blog is using.

    First thing I would do, were this me, would be to get onto my host tech support, explain the problem in detail, ask them for advice and help, see what they can tell me. Then go from there.

    [Note that if your host is some drecky like yahoo, netfirms, or godaddy, the above is NOT likely to get you anywhere at all.]

    Thread Starter knowtown

    (@knowtown)

    Thanks again. That is helpful. And I have an excellent host provider so I think this will work. I will post after I talk with them.

    Thread Starter knowtown

    (@knowtown)

    OK. So I heard back from my host provider tech support team:

    The collation on all of your WordPress databases is currently set to “latin1_swedish_ci,” which is the MySQL default. The latin1_swedish_ci character set should work without issue for any English character storage. We have numerous WordPress installs on our servers (including my personal blog) and I haven’t seen this issue previously. I am going to research the issue a bit further, but it seems you may have encountered a bug in WordPress that is exclusive to your environment/account. I see that you have an installation of WordPress that was installed by Fantastico– do you have the same issue with that install?

    I have two blogs running WP 2.1.1 and they are both having this same issue with the apostrophe creating a syntax error. One was a fantastico clean install with a brand new database and the other is an existing blog that I recently upgraded to 2.1.1. But I also host a friend’s blog on this server in a different folder with its own database. That blog is still running 2.0 and it is not having the issue. So somewhere there is a strange issue with my two 2.1.1 blogs on my server. Not sure what is causing the differnce. If I hear anything else back from my host provider support I will let you know. In the meantime, I am stumped. If anyone knows why my apostrophes are working differently in 2.1.1 than they did in 2.0 and wants to throw me a bone I would appreciate it.

    Well, I’m not running the 2.1 branch at all, so I couldn’t say about that. Hopefully someone with experience in 2.1 can answer definitively.

    Extremely odd though. Not trying to be nasty, but have you done a google search for anything approximating this issue?

    Thread Starter knowtown

    (@knowtown)

    Yes, I have googled this issue and not found anything. There were some distantly related issues with SQL and apostrophes but none of those ideas helpd this case.

    Here is one more interesting thing I just discovered. The problem occurs at the moment the autosave kicks in. after that the error pops up at every auto save and the final publish. However, if I type every think in a word processor and cut and paste it into WordPress and publish before the autosave happens the post publishes with no error.

    I will forward this info to my host provider to see if they have any ideas.

    **UPDATE**
    Actually, when I went back to look at it again the text that I cut and paste from my word processor displays the apostrophy with the look of a comma (the dot with the curl coming down) but the apostrophe when typed within WordPress displays as a straight line. The character is actually a different character. The one from the word processor does not generate an error but when typed within WordPress it does.

    Does anyone know how to change this?

    Maybe try a search at Plugins for something to disable curly quotes? Look down that page a ways, for Post Formatting Plugins….

    Thread Starter knowtown

    (@knowtown)

    I will certainly give this a try but while looking it seems to me that most of these issues that surround curly quotes are exactly the opposite of the one I am having. If I am reading correctly most people have problems when they cut and paste from Microsoft Word into WordPress. I however have success when pasting from Word and not when using WP itself. If the apostrophey looks like the curly quote I get no error. If it does not look like a curly quote I do get the error. So I am not sure I want to disable them. But I will try a couple of different plugins and see what results I get.

    Thanks for the tip.

    Thread Starter knowtown

    (@knowtown)

    I tried quotemark replacer and unfancy quote with no success. Apostrophes still create the error. Double quote marks does not create the error so it is limited to only single quote (apostrophe).

    Well, geesh. That’s one for the books. I honestly haven’t run across this before (2.5 years using wp and posting here), so I’m sceptical it’s a wp bug. However, just for kicks n grins, you could post it to the bug trac: http://trac.wordpress.org; and also post to the wp-hackers list which you can find how to do from http://lists.automattic.com/ – people there are far more able to determine what sort of bork this really is than I am.

    Wish I could be of more help…. sorry!

    Thread Starter knowtown

    (@knowtown)

    No worries vkaryl. And thanks a ton for your help. You were tremendous.

    Thanks…. well, hey, if you get some answers from the “code guri” (*winces*), post back so we know, ‘kay?

    If you are using WordPress 2.1.1, UPGRADE TO 2.1.2 NOW. The problem you are having refers to an exploit that was injected into the 2.1.1 WordPress source. You will see this message on the Dashboard news for WordPress as well, following this link:
    http://wordpress.org/development/2007/03/upgrade-212/

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘apostrophe creates database SQL syntax error’ is closed to new replies.