Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Problems with apostrophes in my product search.

    When i type the full name of a product into the site search it seems to be fire a 1064 error:

    it would appear this is because within the product name there is a ' which has subsequently knocked the mysql code. Any tips for fixing?

    Andy.

    *EDIT*

    Version 1.3.8a
    Last edited by Andy_GS; 2 Sep 2009 at 02:19 PM.

  2. #2
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Zen Cart Product Search.

    Andy,

    This does not happen on my 1.3.8a.... albeit I have modified my search a lot. What is the keyword you are typing in?

    Shrimp

  3. #3
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Zen Cart Product Search.

    well the thing i typed in was the exact name of a product which happens to contain an '

    e.g

    that's amore

    will break the query because it contains an apostraphy.

    Andy.

  4. #4
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Zen Cart Product Search.

    will check on it

  5. #5
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Zen Cart Product Search.

    Works on mine.... have you made any changes to your code?

  6. #6
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Problems with apostrophes in my product search.

    Hey Shrimp,

    to the best of my knowledge nothing has been changed on this. Perhaps there was an update to 1.3.8a that i missed which corrected the problem ill have a look. Basicaly i either need to having somthing remove any invalid chars like ' etc. Or for these to be handled in a different way.

    ill have alook see if there are any minor tweeks that may have been released.

    Andy.

  7. #7
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Problems with apostrophes in my product search.

    Quote Originally Posted by Andy_GS View Post
    Hey Shrimp,

    to the best of my knowledge nothing has been changed on this. Perhaps there was an update to 1.3.8a that i missed which corrected the problem ill have a look. Basicaly i either need to having somthing remove any invalid chars like ' etc. Or for these to be handled in a different way.

    ill have alook see if there are any minor tweeks that may have been released.

    Andy.

    Andy,

    Checked a couple in the live showcase and they worked fine.... checked the one in this thread and it didn't work:

    http://www.zen-cart.com/forum/showthread.php?t=136173

    I'm supposing since none on the dev team have responded that they think something has been modified on your cart to cause this..... you can take the ' out of the keywords but then the searches will not pull back the items you want them to pull back.

    Shrimp

  8. #8
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Problems with apostrophes in my product search.

    I just checked that site from that thread, and typed this in:

    a'dobe

    and it came back with the exact same error i get.

    I just check this one:
    http://www.boxandsupply.com

    and they seem to add a \ where ever there is an '.

    im guessing some sorter:

    PHP Code:
    $var("'","\'",$var); 
    needs to be put somewhere or somthing similar, but i can't quite see from the /includes/modules/pages/advanced_search_result/header_php.php where exactly it should go.

    any ideas?

    Andy.

  9. #9
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Problems with apostrophes in my product search.

    An apostrophe (or single quote) is a special character in php denoting the beginning or end of a string. Putting a \ in front of is "escapes" it - meaning it tells the php that the character shouldn't be intrepreted as the start/end of a string. This has nothing to do with Zen Cart. It's the way php works.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  10. #10
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Problems with apostrophes in my product search.

    Yeah i understand that '' are used within php and that is the reason its not working as stated above.

    So somewhere in the code this tag must be used:

    PHP Code:
    mysql_real_escape_string 
    does this go in:
    /includes/modules/pages/advanced_search/header_php.php

    or

    /includes/modules/pages/advanced_search_result/header_php.php

    and if so where abouts?

    kind regards

    Andy.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problems with price range search on Advanced Search
    By icecold in forum General Questions
    Replies: 1
    Last Post: 6 Nov 2009, 01:12 AM
  2. UTF8 problems with Advanced Search
    By saskvo4 in forum Addon Language Packs
    Replies: 8
    Last Post: 16 Jan 2008, 09:35 AM
  3. [Done v1.3.8] Apostrophes in product names
    By BlindSide in forum Bug Reports
    Replies: 6
    Last Post: 18 Dec 2007, 02:57 AM
  4. having problems with search in header
    By gregoryjameswood in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 29 Jan 2007, 06:37 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR