1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/manual/codes/DQL (Doctrine Query Language) - UPDATE queries.php

17 lines
379 B
PHP

<?php
$q = 'UPDATE Account SET amount = amount + 200 WHERE id > 200';
$rows = $this->conn->query($q);
// the same query using the query interface
$q = new Doctrine_Query();
$rows = $q->update('Account')
->set('amount', 'amount + 200')
->where('id > 200')
->execute();
print $rows; // the number of affected rows
?>