dimanche 27 avril 2014

Error when using charset utf-8


Vote count:

0




When I use mysql_set_charset('utf8') I have this error : Warning: mysql_set_charset() expects parameter 2 to be resource, object given in D:\wamp\www\plateforme\includes\db.php on line 4


This is the code :



<?php
$db = new PDO('mysql:host=localhost;dbname=plateforme', 'root', '');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
mysql_set_charset('utf8',$db);
?>


asked 54 secs ago

hous

60





Aucun commentaire:

Enregistrer un commentaire