When I say,
$this->where('user_id', $some_value) ->update($update_data);
it is not problem until we $some_value is NULL.
if $some_value is NULL normally if we don't use MY_Model it is not problem
BUT on MY_Model when $some_value = NULL then query becomes:
update mytable set update_field=value
I mean
where user_id IS NULL
is not added which updates all the rows in table
I faced this problem several times, in accidently updated all rows, because without using MY_Model I don't have to control if $some_value is null in PHP, QB will generate WHERE user_id IS NULL thus, nothing will be updated.
When I say,
$this->where('user_id', $some_value) ->update($update_data);it is not problem until we $some_value is NULL.
if $some_value is NULL normally if we don't use MY_Model it is not problem
BUT on MY_Model when $some_value = NULL then query becomes:
update mytable set update_field=valueI mean
where user_id IS NULLis not added which updates all the rows in table
I faced this problem several times, in accidently updated all rows, because without using MY_Model I don't have to control if $some_value is null in PHP, QB will generate
WHERE user_id IS NULLthus, nothing will be updated.