session->userdata('user_id'); // Prepare data to insert into forms table $data = array( 'user_id' => $user_id, 'title' => $this->input->post('title'), 'description' => $this->input->post('description') ); // Insert data into forms table $this->db->insert('forms', $data); } } ?>