1
我得到這個錯誤:MySQLiQuery_Exception '有消息' 的歸類(latin1_swedish_ci,隱含的)非法結構和(utf8_general_ci,COERCIBLE) - 用PHP5
Fatal error: Uncaught exception 'MySQLiQuery_Exception' with message 'Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=': select id from 'addresses' where 'shiptozip'='13000' and 'shiptostreet'='Františka Křížka'
正如你所看到的,我想從表格地址中獲取一個ID。
mysql> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
mysql> show variables like 'collation%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
在表格的地址「也有utf8_general_ci
和utf8
。我想這與查詢FrantiškaKřížka有關,因爲可以與其他查詢結合使用。 server_collation曾經是latin_swedish_ci
,但我想我現在已經設法改變了這一切(正如您從上表中看到的那樣)。提前致謝。
是的,所有的字段仍然在latin1上。我會找出如何改變它的所有領域。謝謝! – Ian 2009-04-23 18:03:41