CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

a bug about set()

Open startbbs opened this issue 9 years ago • 2 comments

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

the above Executes: UPDATE lb_userSET item_num = 'item_num+1' WHEREid = '1'

but when I use the follow code UPDATE lb_userSET item_num = item_num+1 WHEREid = '1'

it works well.

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

startbbs avatar Dec 10 '16 01:12 startbbs

If this is a bug, raise the issue here, but you don't also have to cross-post it on the forum. If you don't know if it is a bug, then bring it up on the forum for feedback and/or confirmation, before raising it as an issue.

jim-parry avatar Dec 10 '16 02:12 jim-parry

I will definitely check on that but you can use the increment and decrement methods and not worry about it...

lonnieezell avatar Dec 11 '16 18:12 lonnieezell