1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/codes/DQL (Doctrine Query Language) - Conditional expressions - Input parameters.php

15 lines
447 B
PHP
Raw Normal View History

2006-10-20 23:31:37 +04:00
<?php
// POSITIONAL PARAMETERS:
$users = $conn->query("FROM User WHERE User.name = ?", array('Arnold'));
$users = $conn->query("FROM User WHERE User.id > ? AND User.name LIKE ?", array(50, 'A%'));
// NAMED PARAMETERS:
$users = $conn->query("FROM User WHERE User.name = :name", array(':name' => 'Arnold'));
$users = $conn->query("FROM User WHERE User.id > :id AND User.name LIKE :name", array(':id' => 50, ':name' => 'A%'));
?>