Hi everyone.
This one's being a problem, am hoping that one of you can throw some ideas my way during the debug process. We have a customer whose machine is acting very strangely.
Any insert that contains UTF-8 characters gets truncated! Consider this code:
mysql_query( "INSERT INTO config (`keyname`, `value` ) VALUES ('testvar', 'test ± test' )", DB );
$res = mysql_query( "SELECT * FROM config WHERE keyname='testvar'", DB );
$row = mysql_fetch_assoc( $res );
var_dump( $row )
Only shows "test ".
Everything after the ± gets turfed.
Where to look? I've run out of ideas on this one. The table is UTF--8 charsetted, and the SQL session is running in UTF-8 mode.
CREATE TABLE config (
keyname varchar(50) NOT NULL default '',
value text NOT NULL,
PRIMARY KEY (keyname)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
@( "SET NAMES 'utf8'", $connection );
@( "SET SESSION sql_mode=''", $connection );
PHP 5.2.5
MySQL 5.0.81
CentOS 5
Thanks!
Alex