views:

74

answers:

1

I can't insert special characters. Whenever I try to, all characters BEFORE the special character gets inserted, but after the special character nothing is inserted into the field.

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
mysql_select_db($dbname,$conn);
mysql_set_charset('utf-8', $conn);

mysql_query("SET NAMES 'utf8'") or die(mysql_error());
mysql_query("SET CHARACTER SET 'utf8'") or die(mysql_error());

I have set the table to utf-8 collation, and all fields as well...

Any thoughts?

Thanks

+2  A: 

Have you set the necessary UTF-8 parameters in you PHP config? I used to begin my PHP files with that:

    ini_set("mbstring.internal_encoding","UTF-8");
    ini_set("mbstring.func_overload",7);
Notinlist
..that fixed it..
Camran