Hi all,
I'm new to code igniter but I love it

I have issue with insert_batch, when I try to save multiple row the script no save data
The array:
Code:
Array ( [0] => Array ( [company_name] => thename0 ) [1] => Array ( [company_name] => thename1 ) [2] => Array ( [company_name] => thename2 ) [3] => Array ( [company_name] => thename3 ) )
The controller:
PHP Code:
public function index()
{
$this->load->helper('file');
$json = read_file('./myfile.json');
$obj = json_decode($json);
$data['json'] = $obj;
foreach ($data['json']->res as $val)
{
$batch[] = array(
'company_name' => $val->res->company_name
);
}
$this->my_model->get_json_file($batch);
}
The model:
PHP Code:
public function __construct()
{
$this->load->database();
}
public function get_json_file($data)
{
$this->db->insert_batch('my_table', $data);
}
I have not error message in the page but data not present in the DB.