Differences between how to set the charset in MySQL

0

What is the difference between these two ways of setting the charset in communication with the bank?

$pdo = new PDO("mysql:dbname=qualuqer_db;host=localhost;charset=utf8", "root", "");

and

$pdo = new PDO("mysql:dbname=qualuqer_db;host=localhost", "root", "", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET names utf8"));
    
asked by anonymous 28.02.2018 / 07:03

0 answers