duangangmo0583 2013-08-21 14:22
浏览 48
已采纳

Mysqli绑定参数 - 更新语句 - 引用列+1

I am wondering if mysqli works when binding a column reference +1 type of field. Example.

UPDATE `table` SET  `sys-helpful-yes` = `sys-helpful-yes`+1 WHERE `id` = 1;

When using mysqli bind parameters, it doesn't add the one.

UPDATE `table` SET  `sys-helpful-yes` = ? WHERE `id` = 1;

I am trying to bind

`sys-helpful-yes`+1

Wondering if anyone has a workaround.

  • 写回答

1条回答 默认 最新

  • douqianzha6213 2013-08-21 14:25
    关注

    What about

    UPDATE `table` SET  `sys-helpful-yes` = `sys-helpful-yes`+ ? WHERE `id` = 1;
    

    and then, of course, only bind 1 ... (not tested) ?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?