DQL (Doctrine Query Language) - DELETE queries.php 329 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
$q    = 'DELETE FROM Account WHERE id > ?';

$rows = $this->conn->query($q, array(3));

// the same query using the query interface

$q = new Doctrine_Query();

$rows = $q->update('Account')
          ->where('id > ?')
          ->execute(array(3));
          
print $rows; // the number of affected rows
?>