db->query("SET @@group_concat_max_len =30000"); } public function save_work($work) { $data = array( 'work' => $work['work'], 'image' => $work['image'], 'link' => $work['link'], 'event_id' => $work['event_id'] ); $this->db->insert('author_works', $data); } public function get_works_by_event_id($event_id) { $this->db->select('*'); $this->db->where('event_id', $event_id); $this->db->where('status', 0); return $this->db->get('author_works')->result(); } public function get_works_by_id($id) { $this->db->select('*'); $this->db->where('id', $id); $this->db->where('status', 0); return $this->db->get('author_works')->num_rows(); } public function update_work($work_id, $work) { $data = array( 'work' => $work['work'], 'image' => $work['image'], 'link' => $work['link'] ); $this->db->where('id', $work_id); $this->db->update('author_works', $data); } public function delete_work($id) { $data = array( 'status' => 1 ); $this->db->where('id', $id); $this->db->update('author_works', $data); } }