1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/manual/codes/Basic Components - Query - FROM - selecting tables.php

28 lines
600 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?php
// find all users
$coll = $conn->query("FROM User");
2006-07-24 01:08:06 +04:00
2006-08-17 13:42:18 +04:00
// find all users with only their names (and primary keys) fetched
$coll = $conn->query("FROM User(name)");
2006-08-17 13:42:18 +04:00
2006-07-24 01:08:06 +04:00
// find all groups
$coll = $conn->query("FROM Group");
2006-07-24 01:08:06 +04:00
// find all users and user emails
$coll = $conn->query("FROM User.Email");
2006-08-17 13:42:18 +04:00
// find all users and user emails with only user name and
// age + email address loaded
$coll = $conn->query("FROM User(name, age).Email(address)");
2006-08-17 13:42:18 +04:00
// find all users, user email and user phonenumbers
2006-07-24 01:08:06 +04:00
$coll = $conn->query("FROM User.Email, User.Phonenumber");
2006-07-24 01:08:06 +04:00
?>