2011-09-10 2 views
4
$q = $this->createQuery('q') 
->where('q.group_id=?', $group_id) 
->andWhere('q.content=?', $content) 
    ->execute(); 

(예 : 일본어/중국어)이 다음과 같은 메시지가 발생합니다

SQLSTATE[HY000]: General error: 1267 Illegal mix of collations 
(latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 

전에 비슷한 문제가 발생 했습니까?

답변

1

당신은 (latin1_swedish_ci)

한 부씩 인쇄 기능에 대한 자세한 내용은
$q = $this->createQuery('q') 
->where('q.group_id=?', $group_id) 
->andWhere('q.content = _latin1 ? COLLATE latin1_swedish_ci', $content) 
    ->execute(); 

당신이 한 번 봐 가질 수있는 열 정렬에 인바운드 데이터를 변환해야합니다, where 절에서 MySQL과 한 부씩 인쇄 기능을 사용할 수 있습니다 세부 사항이있는 http://dev.mysql.com/doc/refman/5.6/en/charset-collate.html은 4.1의 mysql에있다.

자세한 내용은 표 구조체 정의 (http://dev.mysql.com/doc/refman/5.6/en/charset-column.html 참조)에서 열 단위로 데이터 정렬을 설정할 수도 있습니다.

희망이 도움이됩니다.

관련 문제