Your table should look like:
CREATE TABLE `new_table` (
`id` bigint(20) NOT NULL auto_increment,
`modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`created` timestamp NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
)
To get the modified/created column changes you need to pass null value while updating or inserting values in a table. Please see the below example to make sense
/* Insert query: */
$pdata = array(
'modified' => null,
'created' => null
);
$val = $this->db->insert('new_table', $pdata);
/* update query: */
$pdata = array(
'modified' => null
);
$this->db->where('id', $id);
$val = $this->db->update('new_table', $pdata);