require_once 'vendor/autoload.php'; use Propel\Runtime\Propel; $books = BookPeer::doSelect(new Criteria()); foreach ($books as $book) { echo $book->getTitle() . "\n"; }
require_once 'vendor/autoload.php'; use Propel\Runtime\Propel; $criteria = new Criteria(); $criteria->add(BookPeer::AUTHOR_ID, 1); $books = BookPeer::doSelect($criteria); foreach ($books as $book) { echo $book->getTitle() . "\n"; }In this example, the doSelect method is used to retrieve all records from the "Book" table where the "author_id" column has a value of 1. The resulting records are then looped through and the title of each book is printed to the console. This example also assumes that the Propel library has been installed using Composer. Package Library: Propel ORM Library for PHP.