10-01-2009, 09:22 AM
[eluser]Bramme[/eluser]
produces this query: "UPDATE `sd_stories` SET `parts` = 1 WHERE `story_id` = '3' AND `id` = '3'"
Not really wanted behavior.
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.