1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/codes/Basic Components - Query - ORDER BY - sorting query results.php
2006-07-23 21:08:06 +00:00

22 lines
607 B
PHP

<?php
// find all users, sort by name descending
$coll = $session->query("FROM User ORDER BY User.name DESC");
// find all users sort by name ascending
$coll = $session->query("FROM User ORDER BY User.name ASC");
// or
$coll = $session->query("FROM User ORDER BY User.name");
// find all users and their emails, sort by email address
$coll = $session->query("FROM User, User.Email ORDER BY User.Email.address");
// find all users and their emails, sort by user name and email address
$coll = $session->query("FROM User, User.Email ORDER BY User.name, User.Email.address");
?>