PHP: Connect Mysql Database Using PDO

<!– <?php $user=’root’; $pass=’www.cheapglasses123.com’; $dbh = new PDO(‘mysql:host=localhost;dbname=yzmedu’, $user, $pass); ?> –> <?php try { $dbh = new PDO(‘mysql:host=localhost;dbname=yzmedu’, $user, $pass); // var_dump($dbh); foreach($dbh->query(‘SELECT * from message’) as $row) {. read more…