Originariamente inviato da Ethan1978
$db->query("SET CHARACTER SET UTF8");
...........................
SET character_set_client = UTF8;
SET character_set_results = UTF8;
SET collation_connection = @@collation_database;
verifica, attraverso la stessa connessione il valore di collation_database:
Codice PHP:
SHOW VARIABLES LIKE 'collation_database'
dallo script, NON (solo) da phpmyadmin
Poi prova anche con SET NAMES
http://dev.mysql.com/doc/refman/5.5/...onnection.html
codice:
SET NAMES 'charset_name' [COLLATE 'collation_name']
SET NAMES indicates what character set the client will use to send SQL statements to the server. Thus,
SET NAMES 'cp1251' tells the server, “future incoming messages from this client are in character set
cp1251.” It also specifies the character set that the server should use for sending results back to the
client. (For example, it indicates what character set to use for column values if you use a SELECT
statement.)
A SET NAMES 'x' statement is equivalent to these three statements:
SET character_set_client = x;
SET character_set_results = x;
SET character_set_connection = x;
Setting each of these character set variables also sets its corresponding collation variable to the default
correlation for the character set. For example, setting character_set_connection to x also sets
collation_connection to the default collation for x.
............
To see the values of the character set and collation system variables that apply to your connection, use
these statements:
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';