illustrate
1. Create a variable called tis, and then you can see that the query function is used in the created $conn object.
2. Run a while loop, create a $row variable, get the content from the $tis object, and finally display each row by calling the list.
Example
$tis = $conn->query('SELECT name, age FROM students'); while ($row = $tis->fetch()) { echo $row['name']."t"; echo $row['age']; echo "<br>"; }
The above is how to run queries in php PDO. I hope it will be helpful to everyone.