9951 explained code solutions for 126 technologies


php-pdoSet charset in PHP PDO


$pdo = new PDO('mysql:host=localhost;dbname=test;charset=utf8mb4', 'usr', 'pwd');ctrl + c
$pdo

PDO connection object

new PDO

create new PDO connection

localhost

Mysql host to connect to

utf8mb4

which charset to use