black cat Posted October 16, 2005 Share Posted October 16, 2005 Hello- I've been receieving the following error message that relates to a post to my WordPress blog: 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 = robots.txt file=20 which is placed at the root level: 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 ('1', '2005-10-13 19:45:36', '2005-10-14 02:45:36', '2005-10-13 19:45:36', '2005-10-14 02:45:36', ' The line that reads "'s = robots.txt file=20 which is placed at the root level:" is part of the test in a post that was submitted a few days ago. Support at WordPress suggests that one possible cause is if the PHP version on the host has been upgraded and the Zend Optimizer has not. I know not what this means but this is where I read it - http://wordpress.org/support/topic/18678 Can you folks tell me if this might be where my problem is? Thanks so much for your time!- Oh yeah, I'm on server 93 black cat Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted October 16, 2005 Share Posted October 16, 2005 Hi black cat, only the help desk can answer such a question. But I run a WP blog and am experiencing no problems. Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted October 16, 2005 Share Posted October 16, 2005 It looks to me like you have a problem with WordPress not escaping quotes (as \') before sending the data to the MySQL database, which may be related to your magic_quotes_gpc PHP setting. Normally, magic_quotes_gpc is set to 'on' on TCH servers, but it can be turned off in an .htaccess file. You might take a look at your .htaccess files and see if 'php_flag magic_quotes_gpc' is being set in any of them either way (on or off). Quote Link to comment Share on other sites More sharing options...
black cat Posted October 17, 2005 Author Share Posted October 17, 2005 Thanks for the quick response guys, and for pointing me in the right direction! I checked my htaccess file and don't see anything that looks like magic_quotes_gpc PHP However, the error is always triggered by the use of single quotes (or apostrophes) in posts submitted via e-mail. Other punctuation is not a problem. I found that some other folks were having the same problem in the WP Support Forum so I posted my ? there too. Know of anywhere else I can check? Thanks again! Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted October 17, 2005 Share Posted October 17, 2005 However, the error is always triggered by the use of single quotes (or apostrophes) in posts submitted via e-mail. Posts submitted by e-mail are significantly different than posts submitted through a web browser: the text in an e-mail post does not get stored in PHP's $_GET, $_POST, or $_SERVER variables. Because of this, the 'magic_quotes_gpc' PHP setting would have no effect on an e-mail post - even if it is set to 'on', PHP would not automatically escape quotes in a post submitted by e-mail. From what I can tell, this may be a bug in the wp-mail.php script (WP support topic, WP bug report). If I'm reading the bug report correctly, it's supposed to be fixed in WP 1.6. Quote Link to comment Share on other sites More sharing options...
black cat Posted October 18, 2005 Author Share Posted October 18, 2005 Thanks SOO much for finding that bug report for me!! I tried the suggested patch for the mail.php file and everything works perfectly now. You guys are the greatest! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.