You’re reading the v0.1 development preview. APIs may change.
~ 1 min readUpdated 2026-10-29

Read from a database

The live website reads a demonstration table through Doctrine DBAL. Its migration seeds three example records.

Query

use Elang\Database\Database;
$rows = $database->table('examples')
    ->orderBy('id', 'ASC')
    ->setMaxResults(3)
    ->fetchAllAssociative();

Try it

curl https://elangphp.com/api/playground/database

Filter safely

$row = $database->table('examples')
    ->where('id = :id')
    ->setParameter('id', 1)
    ->fetchAssociative();

Bind values. Keep identifiers and SQL expressions under application control. The query builder is not an ORM and does not make arbitrary SQL fragments safe.

Need a hand?

Check the troubleshooting guide, look up a term in the glossary, or work through the complete task board project.

Search Elang documentation

Start typing to find your next step.