我需要從表中搜索非UTF字符進行搜索,比如如何與MySQL和PHP
select * from geo where state='Grästorp'
但它並沒有給我任何結果。但是當我使用phpmyadmin運行這個查詢時,它給了我正確的結果。如何在MySQL中使用非UTF-8字符進行搜索?
我需要從表中搜索非UTF字符進行搜索,比如如何與MySQL和PHP
select * from geo where state='Grästorp'
但它並沒有給我任何結果。但是當我使用phpmyadmin運行這個查詢時,它給了我正確的結果。如何在MySQL中使用非UTF-8字符進行搜索?
select * from geo where LIKE'%Grästorp%'collate utf8_bin;
可以查詢其他任何有使用Unicode做之前嘗試
SET NAMES 'utf8'
。
這可能有助於http://stackoverflow.com/questions/14256742/to-use-utf8-or-not-mysql-and-php-character-encoding-issue –