1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Connection - Querying the database.php

17 lines
505 B
PHP
Raw Normal View History

2007-04-14 01:49:11 +04:00
Doctrine_Connection::query() is a simple method for efficient object retrieval. It takes one parameter (DQL query) and optionally prepared statement params.
2007-04-14 01:49:11 +04:00
<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>