LMSouq
php-dev Open

PHP PDO: charset, set names?

KA
Karem
1 month ago
3 views
Problem Description
I had this previously in my normal mysql_* connection: mysql_set_charset("utf8",$link); mysql_query("SET NAMES 'UTF8'"); Do I need it for the PDO? And where should I have it? $connect = new PDO("mysql:host=$host;dbname=$db", $user, $pass, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base