I have both English and Chinese Character in my database.My code is like:
mysql_select_db($database,$con);
mysql_query("set character set 'utf8'");
$result=mysql_query($sqlStatement);
When I select from only one table, Chinese character can returned normally and correctly.
However,when the sql statement is like
select TableA.a from TableA join TableB on TableA.b=TableB.b
the Chinese Character does not work. Result is "?". It seems like each Chinese character corresponds to two "?".
My database:
character_set_client gdk
character_set_connection gdk
character_set_database gdk
character_set_filesystem binary
character_set_result gdk
character_set_server gdk
character_set_system utf8
Anyone can help me ?
Try this,
Check the field's collation are utf8_general_ci.(For example, set utf8_general_ci for your database).
Check the meta tag inside section in html:
May be this helps.
When inserting into the table, try using:
$Var = html_specialchars($_POST['Input_1']);
Tell me if it works :)