Results 1 to 6 of 6
  1. #1

    Default Apostrophes in text boxes cause MySQL error using Supertracker

    I am using Zen Cart 1.3.8a. (Fresh install.) So far it's been great. But I did find a bug...

    I sell signed merchandise in my store, so I use a lot of text boxes for added messages.

    However, if an ' (apostrophe) is used in the text box, upon adding the item to the shopping cart, my database flips out and locks me out of the site. Until I clear my cache, close my browser window, then reopen and go back to the site.

    I get this error:

    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 'WHATEVER MESSAGE WAS ADDED WTH AN APOSTROPHE";}s:10:"attributes";a:1:{i:4;s:1:"0";}}}', cart_total = '5',' at line 1
    in:
    [UPDATE zen_supertracker SET last_click = NOW(), exit_page='/eStore/index.php?main_page=shopping_cart&number_of_uploads=0', exit_page_name='The Shopping Cart', num_clicks=num_clicks+1, added_cart='true', categories_viewed='a:1:{i:12;i:1;}', products_viewed='*25?*5?', customer_id='0', completed_purchase='false', cart_contents='a:1:{s:34:"5:813e40b3c63ea9407afa07ec0fe8d562";a:3:{s:3:"qty";d:1 ;s:17:"attributes_values";a:1:{i:4;s:36:"Use an ' and the database flips out!";}s:10:"attributes";a:1:{i:4;s:1:"0";}}}', cart_total = '5', order_id = '0' WHERE tracking_id='2316']


    I do have Supertracker installed; no problems with it, but I don't know if it has anything to do with the database error or not.
    If you backslash the apostrophe when you type it in the textbox, there are no problems.

    Here's a sample page
    - and you will see where I had to add the comment about backslashing:

    Any help would be much appreciated.

    Thanks, Kim

  2. #2

    Default Re: Apostrophes in text boxes cause MySQL error

    My version of MySQL is:

    Database: MySQL 5.0.75-community-log

    Server OS: Linux 2.6.28-9.5.intel.BHsmp

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Apostrophes in text boxes cause MySQL error using Supertracker

    Seems directly related to a bug in the Supertracker addon. You might try disabling it to confirm that.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4

    Default Re: Apostrophes in text boxes cause MySQL error using Supertracker

    Do you know of any easy way to disable it? I didn't see one offhand in the Supertracker links in my Admin Panel.

    Thanks.

  5. #5
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    843
    Plugin Contributions
    0

    Default Re: Apostrophes in text boxes cause MySQL error using Supertracker

    Reply made in Supertracker thread here: http://www.zen-cart.com/forum/showth...333#post712333 :)
    HunnyBee Design
    "A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

  6. #6

    Default Re: Apostrophes in text boxes cause MySQL error using Supertracker

    Christon26's reply fixed the issue. Please see above post/link for solution.

 

 

Similar Threads

  1. v150 Random Characters when using apostrophes etc
    By Stevis2002 in forum General Questions
    Replies: 11
    Last Post: 12 Aug 2012, 12:18 AM
  2. Restore Database Supertracker Error
    By miles in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Jan 2009, 12:40 AM
  3. mySQL error with YourPay gateway using old version of Zen Cart
    By apathy in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 10 May 2008, 04:30 AM
  4. Replies: 2
    Last Post: 24 Apr 2007, 07:10 AM
  5. 1146 MySql error using newsletter/email
    By mrtorrez in forum Managing Customers and Orders
    Replies: 3
    Last Post: 11 Mar 2007, 10:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg