[eluser]khagendra[/eluser]
Please check $active_record in config/database.php. it should be like this
$active_record = TRUE;
perhaps it may be ok.
please once do like this
Code:
function test1($story_id)
{
$this->db->where('story_id', $story_id);
$updates = $this->db->count_all('sd_story_updates');
$update_no = $updates + 1;
return $update_no;
}
function test2($story_id, $update_no)
{
$this->db->where('id', $story_id);
$this->db->update('sd_stories', array('parts' => $update_no));
}
define two different function(here test1 and test2)in model. get the return value from one model function (here test1). then pass this value to other model function (here test2).
hope u understand it.