I started using PDO recently, earlier I was using just MySQL. Now I am trying to get all data from database.
$getUsers = $DBH->prepare(\"SELECT * FROM use
This code below will do what you are asking for:
$sql = $dbh->prepare("SELECT * FROM users ORDER BY id ASC"); $sql->execute(); while ($result = $sql->fetch(PDO::FETCH_ASSOC)) { echo $result['username'].""; }