CodeIgniter Forums
a bug of set() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: a bug of set() (/showthread.php?tid=66842)



a bug of set() - startbbs - 12-09-2016

here I use
PHP Code:
$db->table('user')->set('item_num','item_num+1',false)->where('id',1)->update(); 
the value of item_num in mysql become "0"

it Executes: (please note red part)

UPDATE `lb_user` SET item_num = 'item_num+1' WHERE `id` = '1'


but when I use the follow code
UPDATE `lb_user` SET item_num = item_num+1 WHERE `id` = '1'

it works well.

I guess the third param($escape) might be a bug. please test, thanks.


RE: a bug of set() - ciadmin - 12-09-2016

If you know that this is a bug, raise it as an issue on github.
If you don't know if it is a bug, then post it here and *not* as a github issue (until confirmed as a bug).
Don't post it on both at the same time.

Even worse (which you didn't do) would be to create multiple posts, each in a different subforum Sad


RE: a bug of set() - ciadmin - 12-09-2016

If you think this is a bug, but aren't sure, the thread should be in the CI4 support subforum, not the discussion one.


RE: a bug of set() - startbbs - 12-09-2016

(12-09-2016, 07:24 PM)ciadmin Wrote: If you think this is a bug, but aren't sure, the thread should be in the CI4 support subforum, not the discussion one.

I got it.