php - Laravel: Addition to an existing field data in a column -


please how express php mysql update code in eloquent

mysql_query("update `some_table` set `value` = `value` + 1000 `id` = 1"); 

or

mysql_query("update `some_table` set `value` = `value` + $formdata `id` = 1"); 

you can retrieve model , increment it:

$model = some_model::find( $id ); $model->value += 1000; $model->save(); 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -