Welcome Guest, Not a member yet? Register   Sign In
active record bug: count_all() does not reset where()
#2

[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.


Messages In This Thread
active record bug: count_all() does not reset where() - by El Forum - 10-01-2009, 09:22 AM
active record bug: count_all() does not reset where() - by El Forum - 10-14-2009, 12:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB