0

I want to populating my sql tables using PHP code. For words with accent like ('pépite') , they are inserted as 'pépite'. Some extra characters are inserted in my string. Here is my code:

$word = 'pépite';
$query = "Insert into [Tracker].[dbo].[Demo] values ('".$word."')";
sqlsrv_query($conn,$query);
echo $word;
// output : pépite

I have tried with utf8_decode as well. But this gives some abstract output.

  • 1
    You need to take care that _all_ components of your toolset use the correct encoding: your browser request, the php engine, the mysql database management system, the connection and last not least the table definitions. – arkascha Feb 15 '16 at 10:07
  • Set your database collation to utf8_unicode_ci – Tomanow Feb 15 '16 at 10:10

0 Answers0