\n"); /* Escape the file */ $escapedfile = mysql_real_escape_string($localfile); /* Print the values after escape */ echo ("After escape:\t"); echo bin2hex($escapedfile); /* Set character set to cp932. Please uncomment to reproduce the problem */ mysql_query ("SET NAMES cp932"); /* Insert the data into the table created by the statement: CREATE TABLE `blob_tbl` ( `c1` BLOB ) ENGINE = MyISAM DEFAULT CHARSET = cp932; */ $result = mysql_query ("INSERT INTO blob_tbl (c1) select '$escapedfile'") or die ("invalid query" . mysql_error(). "\n"); /* Close the connection */ mysql_close($link); ?>