CodeIgniter database insert not inserting

vuboy

New Member
I'm using CodeIgniter to add a record into the database. database.php:\[code\]$db['default']['hostname'] = 'localhost';$db['default']['username'] = 'test_user';$db['default']['password'] = 'test_pwd';$db['default']['database'] = 'test_db';$db['default']['dbdriver'] = 'mysqli';$db['default']['dbprefix'] = '';$db['default']['pconnect'] = TRUE;$db['default']['db_debug'] = FALSE;$db['default']['cache_on'] = FALSE;$db['default']['cachedir'] = '';$db['default']['char_set'] = 'utf8';$db['default']['dbcollat'] = 'utf8_general_ci';$db['default']['swap_pre'] = '';$db['default']['autoinit'] = TRUE;$db['default']['stricton'] = FALSE;\[/code\]insert function in model.php:\[code\]public function set_news(){ $this->load->helper('url'); $slug = url_title($this->input->post('title'), 'dash', TRUE); $data = http://stackoverflow.com/questions/15846643/array('title' => $this->input->post('title'), 'slug' => $slug, 'text' => $this->input->post('text') ); $this->output->enable_profiler(TRUE); return $this->db->insert('news', $data);}\[/code\]I get this output when set_news() runs:\[code\] DATABASE: test_db QUERIES: 1 (Hide)0.0005 INSERT INTO `news` (`title`, `slug`, `text`) VALUES ('come on', 'come-on', 'work')\[/code\]However, when I view the table in the database, it still has zero rows. Any idea what's going on? Thanks!
 
Back
Top