There are two different methods for listing the contents in the table. You can assign the whole result to a variable by using either the default query
method of PDO or the get
method in the class.
<?php
$books = DB::get('SELECT * FROM books ORDER BY price DESC LIMIT 30');
foreach($books as $book)
{
echo $book->title . PHP_EOL;
}
?>