AbanteCart Community

Shopping Cart Operations => Support => Topic started by: thedarksyde on January 28, 2014, 02:49:14 PM

Title: Apostrophe in some fields SQL saving issue 1.18.
Post by: thedarksyde on January 28, 2014, 02:49:14 PM
Could not save a product with an Apostrophe in product description, Meta tag, Meta Description.

Here is the log...

2014-01-28 19:08:05 - database error:  AbanteCart core v.1.1.8 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 World Of Color', '157', '1')' at line 1<br />Error No: 1064<br />INSERT INTO product_tags (`tag`, `product_id`, `language_id`) VALUES ('Walt Disney's World Of Color', '157', '1')  in <b>/home1/darksyde/public_html/core/database/mysql.php</b> on line <b>114</b>

2014-01-28 19:19:06 - database error:  AbanteCart core v.1.1.8 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 Magical World Of Color', '159', '1')' at line 1<br />Error No: 1064<br />INSERT INTO product_tags (`tag`, `product_id`, `language_id`) VALUES ('Disney's Magical World Of Color', '159', '1')  in <b>/home1/darksyde/public_html/core/database/mysql.php</b> on line <b>114</b>

2014-01-28 19:21:47 - database error:  AbanteCart core v.1.1.8 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 Magical World Of Color', '160', '1')' at line 1<br />Error No: 1064<br />INSERT INTO product_tags (`tag`, `product_id`, `language_id`) VALUES ('Disney's Magical World Of Color', '160', '1')  in <b>/home1/darksyde/public_html/core/database/mysql.php</b> on line <b>114</b>
Title: Re: Apostrophe in some fields SQL saving issue 1.18.
Post by: gordontaylor on January 28, 2014, 02:54:11 PM
Yes, the php is seeing it as a tag and creating the error. Meta tags only need the text, extra characters are not indexed, same in the description.
Title: Re: Apostrophe in some fields SQL saving issue 1.18.
Post by: abantecart on January 28, 2014, 08:37:27 PM
Try not to use single quote in the tags.
 
Title: Re: Apostrophe in some fields SQL saving issue 1.18.
Post by: abolabo on January 29, 2014, 09:11:09 AM
i suspect that mysql escape function does not works on your host.
Try  to ask hosting provider support about mysql_real_escape_string for your account ASAP. 
If it really does not work this is dangerous situation for you!
Title: Re: Apostrophe in some fields SQL saving issue 1.18.
Post by: junkyard on February 02, 2014, 10:31:41 AM
they say meta tag keywords and meta descriptions do not matter much for the search engines today... so you could drop using these fields altogether