0

Arabic language search in codeigniter error : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)

In English language search is working

JOIN Query to use to search

SELECT *, `guest`.*, `guest`.`id` as `guestid`, `assistant`.`guest_id` as `assistantid` FROM `guest`
LEFT JOIN `assistant` ON `guest`.`id` = `assistant`.`guest_id`
WHERE   (
`guest`.`id` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`title` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`firstname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`middlename` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`lastname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`arabic_title` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`arabic_firstname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`arabic_middlename` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`arabic_lastname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `company_name` LIKE '%محلل مالي%' ESCAPE '!'
OR  `position` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`country_code` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`mobile_no` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`email` LIKE '%محلل مالي%' ESCAPE '!'
OR  `nationality` LIKE '%محلل مالي%' ESCAPE '!'
OR  `category` LIKE '%محلل مالي%' ESCAPE '!'
OR  `gender` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest_type` LIKE '%محلل مالي%' ESCAPE '!'
OR  `location` LIKE '%محلل مالي%' ESCAPE '!'
OR  `guest`.`remarks` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`id` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`id_user_master` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`guest_id` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`title` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`firstname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`middlename` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`lastname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`arabic_title` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`arabic_firstname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`arabic_middlename` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`arabic_lastname` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`country_code` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`mobile_no` LIKE '%محلل مالي%' ESCAPE '!'
OR  `assistant`.`email` LIKE '%محلل مالي%' ESCAPE '!'
 )
ORDER BY `guest`.`id` DESC
 LIMIT 10

in database "utf8_general_ci"

0
  • Check the connection for being character set utf8
  • Check the application for whether it is using UTF-8

Meanwhile, that looks like an awfully slow query -- lots of ORs and leading wildcard on LIKEs.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.