I want to update a record in a table. I’m using Kohana 3.0 and ORM. My code is as follows –
$photo_sel = $this->where('id','=',$this_photo_id)
->where('user_id','=',$user_id)
->where('is_logo','=','0')->find();
if ($photo_sel->loaded()) {
$this->photo_file_name = $photo;
parent::save();
}
But every time the first record is updated. Instead I want to select and update the record with $this_photo_id.
How can I achieve this ?
If you want to update the selected record, modify and save this record only: