pdo - MySQL Query issue; Illegal mix of collations for operation 'like' -
I do not know what I'm doing wrong in the following questions;
SELECT main.id as id, d.name as departmentName, sectionName as s.name, fullName as m.fullName, as the title of main.title, main Prior to EntryDate pre_tickets, include pre_ticketscategory as main INNER in pre_ticketscategory D on d.id = Main.mainCategory_id IN_ER as s.id = main.category_id INNER mid = main.member_id Join form, where main.softDelete = '0' and main.parent_id = '0' and main.status = '0' and ('main_id' my_query_Å ?? '%' or 'd.name' such as'% my_query_Å ?? Like '% my_query_Å ??'% 'or m.full name like'% my_query_Å? ''% 'Or' main.title 'like' sname. ' '%' Or 'main.entryDate' like '% my_query_Å ??%') by ORDER main.id LIMIT 0, 25 <
all 3 tables (including fields); Illegal mix of collations (including fields) for action; Error / Strong> Character set: UTF-8 Collation: Utf_8_general_ci I am using PDO (I also run queries directly from PHPMYAdmin and Navicat with the same result) I use UTF-8 for my connection ( SET NAMES utf8 command). When I do not use Johns then I do not have this problem.
If I Å ?? , then everything works as expected, no error, although if I do not get the error, then should not support such letters with UTF-8 characters utf_8_general_ci collation? Note: Here's the weird part;
-
If I type Å in my query ?? then my query works (main.id '% my_query%' or '% my_query%' or ''% my_query% 'or' s.name ' Like 'name my_query%' or 'main_name' like '% my_query%' or '% my_query%' like main.title '% my_query%' or main.entryDate). / P>
-
If I in my query Å ?? and extends the main.id and main.entry queries, then my query still works; (e.g., '% my_query_Å ??' or 'sname.' Such as '% my_query_Å ??'% 'or m.full name'% my_query_Å ?? '%' or main.title's Like '% my_query_Å <% 1)
-
If I do not use JOIN , then I Å ?? and still use ID and insertion fields in my query without any problems. SELECT id, title, entry Pre_tickets to date
WHERE
softDelete = '0' and parent_id = '0' and position = '0' and ( ID
-
ID is integer field while entry is the date Time field. I would be happy if someone can explain to me what I am doing and how can I fix this problem?
Since there was no answer, I decided to answer my own question;
I have not really decided it, I got the problem and the query worked as possible without error.
My solution was to remove all integer fields from the query, so I did not get any error. This was not a good solution, but at least it still I have some fields without any errors Used to search.
I hope this will be helpful.
Comments
Post a Comment