db->where('id', $form_id); return $this->db->update('forms', $data); } // Method to retrieve published forms by user public function get_published_forms_by_user($user_id) { $this->db->where('user_id', $user_id); $this->db->where('is_published', 1); $query = $this->db->get('forms'); return $query->result(); } }