0

I have a HTML variable an it contains characters like "●","❒","◉","⭕","■". And i have to store these in MYSQL database. I am using Capsule for this without laravel. There is no problem with printing these characters but when put them into database they show up like this "â—","â—Â". I dont want to remove these characters.

I have tried all html escape functions.

Edit: My database's charset is utf8_general_ci.

1 Answers1

0
 'default' => array(
        'driver'    => 'mysql',
        'host'      => 'localhost',
        'database'  => 'db',
        'username'  => 'root',
        'password'  => '',
        'charset'   => 'utf8', // <-- that fixed my problem
        'collation' => 'utf8_general_ci'  //  <-- that fixed my problem
    ),

I have added charset to eloquent connection settings and it fixed my problem.