1
0
mirror of synced 2025-01-10 11:07:10 +03:00
doctrine2/manual/codes/DQL (Doctrine Query Language) - DELETE queries.php

17 lines
357 B
PHP
Raw Normal View History

<?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();
2007-04-12 20:33:08 +04:00
$rows = $q->delete('Account')
2007-04-12 20:34:33 +04:00
->from('Account a')
2007-04-12 20:33:08 +04:00
->where('a.id > ?', 3)
->execute();
print $rows; // the number of affected rows
?>