• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a bug of set()

#1
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.
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply


Messages In This Thread
a bug of set() - by startbbs - 12-09-2016, 06:09 PM
RE: a bug of set() - by ciadmin - 12-09-2016, 07:22 PM
RE: a bug of set() - by ciadmin - 12-09-2016, 07:24 PM
RE: a bug of set() - by startbbs - 12-09-2016, 07:40 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.