So I'm trying to connect to a DB with PDO. I was able to do this earlier today, but now I'm not sure if its working because when I enter wrong credentials I get errors. Here's my code
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$host = "localhost";
$pass = "root";
$dbname = "users";
$user = "root";
try{
$con->pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
$con = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
}
catch(PDOException $e){
echo $->getMessage();
}
When I run any other script they work fine. Anyone see any errors? Also this is what I see in my dev tools when running it. This only happens with the code above.
