PHP PDO包装器更新+1

As stated in the title, how do I update the field by adding +1?

I'm using a PDO wrapper class from http://www.imavex.com/php-pdo-wrapper-class/index.php

I tried the code below and it's not updating the field:

1. $update = array('log' => 'log+1');
2. $update = array('log' => '+1');

$DB->update('user', $update, "idClient = 1");

Please help!

This is the query you are ultimately shooting for:

"UPDATE user SET log = log + 1 WHERE idClient = 1";

With that PDO syntax, I am assuming it would look something like:

$update = array('log' => 'log +1');
$DB->update('user', $update, 'idClient = 1');

Edit:

The errors need to be logged, check this out: https://stackoverflow.com/a/2413308/185672

You can also try this way and it is safe as well

$sql = 'UPDATE user SET log = log + 1 WHERE ( idClient = :userid )';
$prepStatement = $pdo->prepare( $sql );
$prepStatement->execute(array(':userid' => 1));