Forum Moderators: coopster
$line=htmlspecialchars($_POST['cp_cat_line']);
$name=htmlspecialchars($_POST['cp_cat_name']);
$sql="INSERT INTO cp_category (cp_cat_line, cp_cat_name)
VALUES ('$line', '$name')";
show variables The easiest thing to do is to find out what character encoding your MySQL data is in
...and then make sure the PHP web application uses it to communicate with MySQL
The PHP function "mysql_client_encoding" returns what character set PHP is using to communicate with the MySQL database.
You inform the browser to use a character set either in the HTTP header or in a meta tag.
You can confirm what character set Firefox is using by control clicking the page and selecting "View Page Info."
(1) You can check phpInfo() for a default PHP encoding (default_charset) but it may just tell you "none set".
(2) In MySQL, it's possible to override the database's default character set for a schema (ie an individual "database") or a table. You can check the character set for the given table with the SQL statement: SHOW TABLE STATUS
The PHP function "mysql_client_encoding" ...
This returns "latin1"
isn't that what mysql_query("SET NAMES utf-8"); is for?
mysql_set_charset( 'utf8' ); declare(encoding='utf8');