The problem pops out when stricton => TRUE. I was trying to insert an empty string into an int column. What is still obscure to me is the first time I load the page and submit data via ajax, $data['x'] equals NULL. If I re-submit same data without refreshing page, $data['x'] equals "" (empty string).
This is how I get data from post
PHP Code:
$data['x'] = $this->input->post('x');