SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Very odd error with foreign characters in mySQL db search

    Getting a strange error if users try inputting any characters which are Russian / Polish (haven't tried other character sets yet) into their search using AjaxSearch (an Ajax-based search facility that queries a mySQL db) on our site:

    Code:
    MODx encountered the following error while attempting to parse the requested resource: 
     Execution of a query to the database failed - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like'  
          SQL: SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon, GROUP_CONCAT( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, GROUP_CONCAT( DISTINCT ntv.value SEPARATOR ", " ) AS tv_value FROM `expotel_site_content` sc LEFT JOIN( SELECT DISTINCT tv.id, tv.value, tv.contentid FROM `expotel_site_tmplvar_contentvalues` tv WHERE (((tv.value LIKE '%łdfdfłłgh%'))) ) AS ntv ON sc.id = ntv.contentid WHERE ((sc.published=1) AND (sc.searchable=1) AND (sc.deleted=0) AND (sc.type='document') AND (sc.privateweb=0)) GROUP BY sc.id HAVING (((sc.pagetitle LIKE '%łdfdfłłgh%') OR (sc.longtitle LIKE '%łdfdfłłgh%') OR (sc.description LIKE '%łdfdfłłgh%') OR (sc.alias LIKE '%łdfdfłłgh%') OR (sc.introtext LIKE '%łdfdfłłgh%') OR (sc.menutitle LIKE '%łdfdfłłgh%') OR (sc.content LIKE '%łdfdfłłgh%') OR (tv_value LIKE '%łdfdfłłgh%'))) ORDER BY sc.publishedon,sc.pagetitle
    Any ideas what might be causing this? And how to fix?

  2. #2
    SitePoint Member Q.E.D.'s Avatar
    Join Date
    Oct 2009
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are the collations on each of your your tables?


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
  •