Help!! PHP PDO connection MySQL failed
In the conn.php with the PDO to connect to the local MySQL database, but the PHP Web page submitted by the data is not stored in MySQL, but run conn.php not error, do not know where the problem is!! Tangled up for three days!! Come on, guys, look.
try {
$dns = ' mysql:host=localhost;dbname=satcliv8;port=3306 ';
$utilisateur = ' root ';
$motDePasse = ";
$connection = new PDO ($dns, $utilisateur, $motDePasse,
Array (Pdo::mysql_attr_init_command = "SET NAMES UTF8"));
} catch (Exception $e) {
echo "Connection?? MySQL impossible: ", $e->getmessage ();
Die ();
}
?>
------to solve the idea----------------------
You're just connecting.
How do you use it?
------to solve the idea----------------------
Http://www.w3cschool.cc/php/pdo-errorinfo.html
Use this to check MySQL error, try it
------to solve the idea----------------------
Look at the error log.
------to solve the idea----------------------
Host unknown is not found host, how do you connect? IP or domain name.
Put it on.