[eluser]Armchair Samurai[/eluser]
Cleaned for readability. Also, you may want to change that SQL NOW() to date('H:i
') because I'm pretty sure that with CI escaping, it might not do what you want it to.
Code:
$this->db->set(array(
'topic_title' => $post_subject,
'topic_poster_id' => $this->session->userdata('id'),
'topic_time' => NOW(),
'forum_id' => $this->uri->segment(3)
));
$this->db->insert('sb_topics');
$topic_id = $this->db->insert_id();
$this->db->set(array(
'post_subject' => $post_subject,
'post_message' => $post_message,
'poster_id' => $this->session->userdata['id'],
'topic_id' => $topic_id
));
$this->db->insert('sb_posts');