Salvo Posted February 14, 2004 Posted February 14, 2004 Hi all, I have just noticed that using user_tracking or maybe it is something else, when a cateogry or product includes apostrophes ie. St. Paul's, it give me an error 1064 - Erreur de syntaxe pr?s de 's')' ? la ligne 1 insert into user_tracking (customer_id, full is there way to about it without compromising the use of ( ' ) in the world? I have many Italian words with the apostophe, I wouldn't like to change them all. Thanks Salvo
241 Posted February 14, 2004 Posted February 14, 2004 when ' apostrophes are used mysql interprets these as code so you need to place \ before a ' as in St. Paul\'s, No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
Salvo Posted February 14, 2004 Author Posted February 14, 2004 Yes, I know that, the only problem is that the apostrophes is in the category name and If I try to put St. Paul\'s, it delete the \ and I don't know why. Try it.. The error occurs because I am using the user trucking contribution, that insert the category name into the table with the apostrophe. is there a way around it? Thanks Salvo
OceanRanch Posted February 15, 2004 Posted February 15, 2004 How about using ' in place of the ' This might work some places and not others but it's worth a try...... Tom
OceanRanch Posted February 15, 2004 Posted February 15, 2004 The post hid the actual html equivalent of quote..... :-) ampersand#39; Try this.... Tom
241 Posted February 15, 2004 Posted February 15, 2004 try this code in place of an apostrophe here I have to seperate the code eliments or you will just see ' followed by 39; take the first part of the code and place it together with the second part of the code so that you have no spaces this number code gives an apostrophe No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
user99999999 Posted February 15, 2004 Posted February 15, 2004 Hi, This comes from your magic_quote setting in php.ini or .htaccess. I dont think OSC does the right check for this like HERE in the example. Try adding this to your .htaccess <IfModule mod_php4.c> php_flag magic_quotes_gpc On </IfModule>
Salvo Posted February 16, 2004 Author Posted February 16, 2004 Hi, This comes from your magic_quote setting in php.ini or .htaccess. I dont think OSC does the right check for this like HERE in the example. Try adding this to your .htaccess <IfModule mod_php4.c> php_flag magic_quotes_gpc On </IfModule> This didn't work here where the error is 1064 - Erreur de syntaxe pr?s de 's Cathedral')' ? la ligne 1 insert into user_tracking (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, page_desc) values ('', 'Guest', '09a3e1d134fa73f0fc5830f1bd34c498', 'ip', '1076996753', '1076996753', '/site2004/product_info.php?cPath=1_17&products_id=180&osCsid=09a3e1d134fa73f0fc5830f1bd34c498', 'St. Paul's Cathedral') Any other help is appreciated Salvo
user99999999 Posted February 17, 2004 Posted February 17, 2004 Check in your admin -> tools -> server info It should have 'magic_quotes_gpc On' in there. Try changing it in php.ini
user99999999 Posted February 17, 2004 Posted February 17, 2004 ok I thought you ment when you create a category you get that error. Try this user_tracking.php line 52 $page_desc = $page_desc_values['categories_name']; $page_desc = addslashes($page_desc_values['categories_name']);
Salvo Posted February 17, 2004 Author Posted February 17, 2004 I have changed like this and still don't work should I change them all? how do you change the master? magic_quotes_gpc On Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off this is this in the php.ini ; - magic_quotes_gpc = Off [Performance] ; Input data is no longer escaped with slashes so that it can be sent into ; SQL databases without further manipulation. Instead, you should use the ; function addslashes() on each input element you wish to send to a database. How and where do you add the function addslashes() ?
user99999999 Posted February 17, 2004 Posted February 17, 2004 Your problem was only with this mod. Edit this file catalog/includes/functions/user_tracking.php line 52 Change this $page_desc = $page_desc_values['categories_name']; To this $page_desc = addslashes($page_desc_values['categories_name']);
Salvo Posted February 17, 2004 Author Posted February 17, 2004 Dave, I will try your advice tonight (GMT TIME) and I will let you know. Thanks Salvo
Salvo Posted February 17, 2004 Author Posted February 17, 2004 Your problem was only with this mod. Edit this file catalog/includes/functions/user_tracking.php line 52 Change this $page_desc = $page_desc_values['categories_name']; To this $page_desc = addslashes($page_desc_values['categories_name']); Well Done Dave I have added addslashes and it worked very well Thank you Salvo
Recommended Posts
Archived
This topic is now archived and is closed to further replies.