$con = new PDO("mysql:dbname=database_name;host=localhost", "user_name", "password");
$sql = $con->prepare("SELECT * FROM table_name");
$sql->execute();
while ($row = $sql->fetch(PDO::FETCH_ASSOC)) {
echo $row['column_name'] . "<br>";
}
/*
run:
data
data
data
...
*/