0

I am using PHP and is inserting chinese characters to MySQL from my system. I used the prefix N but I encountered some error. Here is my code.

$insert = "INSERT INTO BK (language, id, names) VALUES ('N':language'', ':id', 'N':names'')";
$stmtNew = $dbRemote->prepare($insert);  
$stmtNew->bindValue(':language', $Val['Language']);
$stmtNewL->bindValue(':id', $ID);
$stmtNewL->bindValue(':names', $langVal['Name']);
$stmtNewL->execute();

What could be my problem?

M Hamza Javed
  • 1,269
  • 4
  • 17
  • 31
bleyk
  • 799
  • 3
  • 14
  • 41
  • 1
    What is the error? also Is your colum or table character encoding (Collation) set to `utf8_*` or `utf8mb4_*` ? – Scuzzy Apr 26 '17 at 08:00
  • How to set table into utf8mb4? I am not sure @Scuzzy – bleyk Apr 26 '17 at 08:01
  • Possible duplicate of [How to insert chinese character in mysql table?](http://stackoverflow.com/questions/4265247/how-to-insert-chinese-character-in-mysql-table) – Script47 Apr 26 '17 at 08:05
  • You really should Google before you ask, if you just Googled your question title, you would have found your answer. – Script47 Apr 26 '17 at 08:06
  • @bleykFaust what is the error? – Scuzzy Apr 26 '17 at 08:36
  • Possible duplicate of [Can't insert Chinese character into MySQL](http://stackoverflow.com/questions/14456313/cant-insert-chinese-character-into-mysql) – DaveP Apr 26 '17 at 08:54
  • @Scuzzy It shows an error on the last statement but I don't know why it happens – bleyk Apr 27 '17 at 00:06
  • @bleykFaust I can't help you sorry unless you copy and paste the _exact error message_ returned by the failing function call. – Scuzzy Apr 27 '17 at 01:04

0 Answers0