• Resolved tremaine

    (@tremaine)


    I just upgraded WP 1.5.1.2 to 1.5.1.3 (after backing up the entire directory and mysql db of course!) and can no longer post via email to my blog at https://blog.ddiction.com/

    I get the following errors when going using wp-mail.php

    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 a very odd experience to see your arm and hand responding co]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name, comment_status, ping_status, post_parent) VALUES ('3', '2005-07-09 20:28:57', '2005-07-10 03:28:57', '2005-07-09 20:28:57', '2005-07-10 03:28:57', '

    This is then followed by the content of the email post, then followed by more errors

    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 3]
    SELECT category_id FROM wp_post2cat WHERE post_id =

    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 ' 1)' at line 2]
    INSERT INTO wp_post2cat (post_id, category_id) VALUES (, 1)

    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 pinged FROM wp_posts WHERE ID =

    Any mysql gurus out there know what’s happening here and how I can fix it? I can still post normally from within the admin interface, but I use the wp-mail function because I post to multiple places at the same time via email.

Viewing 9 replies - 16 through 24 (of 24 total)
  • That seemed to fix it – just not parsing the HTML correctky, but i can live with it.

    Thanks a Million!!

    Well – how great is this, upgrading to versi 1.5.2 breaks the configuration change. I have no clue why this was not bundled into the software, but it wasn’t. So after upgrading having to go back in and make the change.

    Any reason it was not added?

    Simple oversight, most likely. The milestone set on the ticket is 1.6. Version 1.5.2 was kind of an unexpected release specifically to fix a security problem. We were able to include a handful of feature enhancements into it, but we obviously didn’t reflag every ticket from a 1.6 milestone to 1.5.2.

    This fix ought to be bundled into 1.6, whenever that is released.

    The addfilter… line does work, fixing apostrophe crashes if there is one in the body, thanks.

    The post still breaks if there is an apostrophe in the subject line though, you have to manually escape it.

    I’m using the addfilter line along with this patch:
    https://trac.www.ads-software.com/ticket/1515

    Maybe they don’t work together so well? Or maybe they do and the addfilter doesn’t work on subject lines, no clue. I haven’t tried an apostrophe post without the above 1515 since my phone post requires the 1515 patch as well.

    I was having the same problems with the apostrophe in the Subject line or email content. So, I looked for another plugin and found Postoe, which I couldn’t get to work.

    I just tried the fix in ticket #1515 but it still didn’t like the apostrophe in the email content.

    I’ll try a couple more tests.

    Well #1515 is just for fixing the subject line, it has nothing to do with apostrophes, only reason I mentioned it was because I didn’t test add_filter without it.

    Here is the add_filter ticket: https://trac.www.ads-software.com/ticket/1536

    It fixes all apostrophe problems for me in the email content, just make sure to manually escape apostrophes in the subject line.

    Thanks for the information. I’m using wp-cron and its wp-cron-mail plugin. It had the same problem but Skippy helped me modify the wp-cron-mail.php in a similar fashion except using addslashes(). Bottomline, it works.

    Now I’m working with the Postie plugin author to figure out how to eliminate the email formatting problems I have in the post.

    Thanks again skippy.

    Alternately, add this to wp-mail.php to correctly handle apostrophes in the subject:
    $subject = addslashes($subject[0]);

    In a stock wp-mail.php, that should replace the contents of line 58.

    Perfect! Thanks skippy.

    #1515 & #1536 + $subject/addslashes all work together in harmony. All I need now is the base64 bug (#1655) fixed and I’ll be in moblog heaven.

    I hope there is a bug fix 1.5.x release soon, this 1.6 wait to officially get wp-mail bugs squished is going to be a tough wait for many I think.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘mysql errors with wp-mail after upgrade to 1.5.1.3 from 1.5.1.2’ is closed to new replies.