Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel increment column value in update query

DB::table('my_table')
   ->where('rowID', 1)
   ->update([
       'column1' => DB::raw('column1 + 2'),
       'column2' => DB::raw('column2 + 10'),
       'column3' => DB::raw('column3 + 13'),
       'column4' => DB::raw('column4 + 5'),
   ]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #increment #column #update #query
ADD COMMENT
Topic
Name
2+3 =