This is an old revision of the document!
<?php
error_reporting(-1);
ini_set('display_errors', 1);
$host = "localhost";
$username = "coding_user";
$password = "cheese";
$db_name = "coding";
$mysql_string = "mysql:host=$host;dbname=$db_name";
$db_connection = new PDO($mysql_string, $username, $password);
$sql = "select * from test_table";
$rs = $db_connection->query($sql);
$rows = $rs->fetchAll();
echo "<pre>";
var_dump($rows);
echo "</pre>";
?>