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

[eluser]Bramme[/eluser]
Code:
// amount of updates
$this->db->where('story_id', $story_id);
$updates = $this->db->count_all('sd_story_updates');
$update_no = $updates + 1;

// update story with correct number of updates
$this->db->where('id', $story_id);
$this->db->update('sd_stories', array('parts' => $update_no));

produces this query: "UPDATE `sd_stories` SET `parts` = 1 WHERE `story_id` = '3' AND `id` = '3'"

Not really wanted behavior.


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