1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Connection - Querying the database.php

17 lines
520 B
PHP

Doctrine_Connection::query() is a simple method for efficient object retrieval. It takes one parameter (DQL query) and optionally prepared statement params.
<code type="php">
// select all users
$users = $conn->query('FROM User');
// select all users where user email is jackdaniels@drinkmore.info
$users = $conn->query("FROM User WHERE User.Email.address = 'jackdaniels@drinkmore.info'");
// using prepared statements
$users = $conn->query('FROM User WHERE User.name = ?', array('Jack'));
</code>