PHP to get the post content of the HTML to the database, inserted after the display garbled, my database encoding has been set to UTF8, and then inserted before I echo out is not garbled, but into the database inside is garbled, do not know why, asked before I have searched, said to first execute
mysql_query ("SET NAMES ' uft8 '", $link);
In this way, I do so after the implementation and then refresh or the same, do not know how to solve, if a page resolved, if more than one page needs to insert into the data how to do it, please have experience to tell, thank you.
Reply to discussion (solution)
Did you set the encoding of your PHP page?
Header (' Content-type:text/html;charset=utf-8 ');
?>
Set up, my PHP page defaults to a new open automatically will be loaded into this sentence.
Yes, mysql_query ("SET NAMES ' uft8 '", $link);
UTF8 Best written UTF8
Is database determination also UTF-8 encoded? Right-click Database properties to see!
Look at the encoding of your editor
It's settled, thank you.
I also encountered garbled, seek to solve
mysql_select_db ("Set names UTF8");
Header (' Content-type:text/html;charset=utf-8 ');
Include "connect.php";
CREATE TABLE ' UserInfo ' (
' ID ' varchar (+) not NULL COMMENT ' primary key ID ',
' Truename ' varchar (+) DEFAULT NULL COMMENT ' name ',
PRIMARY KEY (' id ')
) Engine=myisam DEFAULT Charset=utf8;
So the place is set to UTF-8, or in garbled, novice just learn, ask the great God advice