Click here to Skip to main content
15,791,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to add addon on availbility by pincode on oscommerce site --
But it shows the following error.


How to solve it ?

What I have tried:

SQL
INSERT INTO `configuration` VALUES ('', 'Auswahl der Produktverfügbarkeit', 'MAX_PRODUCTS_AVAILABILITY_LIST', '1', 'Produktverfügbarkeitsanzeige: Wenn dieser Wert \ '1 \ ' überschreitet wird die klassische Drop-Down-Liste für die Verfügbarkeit des Produktes verwendet. Andernfalls wird eine List-Box mit der angegebenen Anzahl von Zeilen angezeigt werden.', 7, 98, NULL, now(), NULL, NULL);


But it shows the error --
C#
#1064 - 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 \ ' überschreitet wird die klassische Drop-Down-Liste für die Verfügbarkeit' at line 1 
Posted
Updated 16-Mar-16 2:14am

1 solution

Your problem is the way you are trying to insert single-quotes ' into your text, specifically
Produktverfügbarkeitsanzeige: Wenn dieser Wert \ '1 \ ' überschreitet wird die klassische Drop-Down-Liste für die Verfügbarkeit des Produktes verwendet.


There are a few ways around this ...
Firstly there should be no spaces between the \ and the '. I.e. it is \' not \ '

OR

You can double up the single quotes instead
'Produktverfügbarkeitsanzeige: Wenn dieser Wert ''1 '' überschreitet wird die klassische...etc.'


OR

If you use parameterized queries / prepared statements which should take care of this issue for you - see PHP: Prepared Statements - Manual[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900