database query, query the number or English can, query Chinese error: Prompt????????????: SELECT * from Szdbdb_userdata where truename= '???? '
Illegal mix of collations (gb2312_chinese_ci,implicit) and (latin1_swedish_ci,coercible) for operation ' = ' 12670
Workaround: The general online will say is the encoding problem, in the configuration file My.ini modify the database encoding. When all encodings are set to be consistent, this consideration is what is chosen when the database is established. Open the database to see. If it's different, you'll have to rebuild the database. Also check the query code.
$sql = "Select * FROM {$pre}userdata where truename= ' $stext '";
$d 1= $db->query ($sql);
$num =mysql_num_rows ($d 1);
Switch
$query 1=mysql_query ("select * from {$pre}userdata where truename= ' $stext '");
$num =mysql_num_rows ($query 1);
This may be because $d1= $db->query ($sql) and transcoding causes errors.
database query, query numbers or English can, query Chinese error