Author Topic: Apostrophe in some fields SQL saving issue 1.18.  (Read 5894 times)

Offline thedarksyde

  • Full Member
  • ***
  • Posts: 131
  • Karma: +7/-1
    • View Profile
Apostrophe in some fields SQL saving issue 1.18.
« 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>

gordontaylor

  • Guest
Re: Apostrophe in some fields SQL saving issue 1.18.
« Reply #1 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.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Apostrophe in some fields SQL saving issue 1.18.
« Reply #2 on: January 28, 2014, 08:37:27 PM »
Try not to use single quote in the tags.
 
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Apostrophe in some fields SQL saving issue 1.18.
« Reply #3 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!
« Last Edit: January 29, 2014, 09:58:23 AM by abolabo »
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline junkyard

  • Full Member
  • ***
  • Posts: 127
  • Karma: +25/-0
    • View Profile
Re: Apostrophe in some fields SQL saving issue 1.18.
« Reply #4 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

 

Powered by SMFPacks Social Login Mod