【发布时间】:2021-02-23 01:23:02
【问题描述】:
我已阅读此主题:Issues incrementing a field in MySQL/PHP with prepared statements,但没有看到我的问题的答案。
PDOStatement Object
(
[queryString] => UPDATE user_alerts SET notif = ? + 2 WHERE ( user_id = ? )
)
$stmt->execute( array( 'notif', '1' ) );
据我所知,这一切都是正确的。
当上面的代码执行时,它设置notif 列等于2,而不管notif 列的值是什么。就好像 SQL 读起来像 SET notif = 2 而不是 SET notif = notif + 2
我无法弄清楚,非常感谢帮助!
【问题讨论】: