• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to increment DB Column value using Active Record Class

#1
[eluser]sheri.nust[/eluser]
Hey ,

I want to update my DB column, for this i have successfully run the following query.
and updated column "TotalMembers" by 1.

But now i want to do this using Active Record Class in CI,
Can anyone help me how i have to do this?

Code:
UPDATE
   GBSociety  
     SET TotalMembers=TotalMembers+1  // incremented by 1 or some value e,g ,10,12. etc
     WHERE SocietyID=$pSocietyID;

#2
[eluser]jedd[/eluser]
Does [url="http://ellislab.com/forums/viewthread/62630/"]this thread[/url] help?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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