Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / All Other Contributions/Addons / How Did You Hear About Us? Apostrophe in Other

How Did You Hear About Us? Apostrophe in Other

Locked

Started by dreamz on 14 Feb 2009, 6:25 PM · Views: 791

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
14 Feb 2009, 6:25 PM
#1
dreamz avatar

dreamz

New Zenner

Join Date:
Oct 2007
Posts:
52
Plugin Contributions:
0

How Did You Hear About Us? Apostrophe in Other

I have other referrals set up and that is what my customers mostly use so I can track magazines, tv etc. Whenever anyone enters a word with an apostrophe in it like Scruffy's, I get the following error code and I have to go into the database and remove the apostrophe so that the module will show the rest of the referrals for that page. Has anyone been able to fix this bug?

>

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 's' order by ci.customers_info_id DESC' at line 1

in:
[select ci.customers_info_id, ci.customers_info_date_account_created from customers_info ci, sources_other so where so.customers_id = ci.customers_info_id and so.sources_other_name = 'Scruffy's' order by ci.customers_info_id DESC]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

24 Feb 2009, 10:00 PM
#2
dreamz avatar

dreamz

New Zenner

Join Date:
Oct 2007
Posts:
52
Plugin Contributions:
0

Re: How Did You Hear About Us? Apostrophe in Other

Anyone have an idea about how to fix this - it pretty much ruins the module.

2 Apr 2009, 3:00 PM
#3
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: How Did You Hear About Us? Apostrophe in Other

I have the same problem with orders. If the customer has an apostrophe in their name or their company name, then MYSQL just barfs all over it...

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 'Testing [x_company] => Pete's Place [x_address] => 123 Pike's Peak [' at line 1
in:
[insert into CH_authorizenet (id, customer_id,order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values ('', '935', '705821', '2', 'This transaction has been declined.', 'auth_only', '2371937802', 'Array ( [x_login] => ******* [x_tran_key] => ******* [x_relay_response] => FALSE [x_delim_data] => TRUE [x_version] => 3.1 [x_type] => AUTH_ONLY [x_method] => CC [x_amount] => 189.00 [x_card_num] => *******1111 [x_exp_date] => 0111 [x_card_code] => ******* [x_email_customer] => TRUE [x_email_merchant] => TRUE [x_cust_id] => 935 [x_invoice_num] => 705821 [x_first_name] => Iam [x_last_name] => D'Testing [x_company] => Pete's Place [x_address] => 123 Pike's Peak [x_city] => Colorado Springs [x_state] => Colorado [x_zip] => 80901-1575 [x_country] => United States [x_phone] => 719-385-7325 [x_email] => [email protected] [x_ship_to_first_name] => Iam [x_ship_to_last_name] => D'Testing [x_ship_to_address] => 123 Pike's Peak [x_ship_to_city] => Colorado Springs [x_ship_to_state] => Colorado [x_ship_to_zip] => 80901-1575 [x_ship_to_country] => United States [x_description] => Color-Helper and Cant Fail Color Schemes Bundle(qty: 1) [Date] => April 2, 2009, 9:39 am [IP] => 96.11.67.36 [Session] => 04198bf360da02e5574e950146287240 [url] => https://secure.authorize.net/gateway/transact.dll ) ', '1=2&2=1&3=2&4=This+transaction+has+been+declined.&5=&6=U&7=2371937802&8=705821&9=Color-Helper+and+Cant+Fail+Color+Schemes+Bundle%28qty%3A+1%29&10=189.00&11=CC&12=auth_only&13=935&14=Iam&15=D%27Testing&16=Pete%27s+Place&17=123+Pike%27s+Peak&18=Colorado+Springs&19=Colorado&20=80901-1575&21=United+States&22=719-385-7325&23=&24=piker%40peaks.com&25=Iam&26=D%27Testing&27=&28=123+Pike%27s+Peak&29=Colorado+Springs&30=Colorado&31=80901-1575&32=United+States&33=&34=&35=&36=&37=&38=63A664F4159EB19E1F9171926E280BE2&39=&40=&41=&42=&43=&44=&45=&46=&47=&48=&49=&50=&51=&52=&53=&54=&55=&56=&57=&58=&59=&60=&61=&62=&63=&64=&65=&66=&67=&68=&69=April+2+2009+9%3A39+am&70=96.11.67.36&71=04198bf360da02e5574e950146287240', 'April 2, 2009, 9:39 am', '04198bf360da02e5574e950146287240')]What's interesting is that the name and company name make it into the database as a customer, but when that data gets moved into an order, then the error occurs.

Worse, if you use Authorize.net, the card is processed but Zen Cart does not have the order. Fortunately, we authorize at checkout and capture in a second step so we don't have to credit people who try multiple times.

Zen Cart v1.3.7

I have been searching through the forums but all I can find is that you need to insert a backslash before a quote when defining some text, I haven't seen this problem. I find it hard to believe that we're the only one who has a customer with an apostrophe in their name or company name.

All that is by way of saying, I apologize in advance if this has been answered before. Any help would be greatly appreciated.

Thanks.
Help would be appreciated.

2 Apr 2009, 3:59 PM
#4
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: How Did You Hear About Us? Apostrophe in Other

OK, I screwed up twice here.

  1. I posted in the wrong forum - My issue was with checkout

  2. I didn't search long enough.

Going back to 2007, I found that there is some kind of patch for apostrophes.

http://www.zen-cart.com/forum/showthread.php?p=354897#post354897

The code in this patch might help.

Sorry.