I like the convenience methods for processing data requests $ conn-> insert () and $ conn-> update () in the 2 DBAL doctrine, since insert / update values ββcan be passed as an associative array. But how can I pass a NULL value, a MySQL function, or other expressions as a value?
eg:
$conn->update('person', array('phone' => 'NULL'), array('id' => 1)); $conn->update('person', array('lastlogin' => 'NOW()'), array('id' => 1)); $conn->update('person', array('visit' => 'visit + 1'), array('id' => 1));
These function calls would create prepared expressions like
UPDATE person SET phone = ? WHERE id = ?
and therefore, the values ββwill be treated as strings. Is there any way to do this work using this technique?
php mysql doctrine doctrine2 dbal
Mario a
source share