Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array' at line 1
INSERT INTO agenda
() VALUES ('15','1','$2y$10$zE94wOg6xEpMfgU8bMzMmeBdKyFbU9UkmbwcTnlxftyD8jISDBpvG','1','admin'), Array
Filename: C:/xampp/htdocs/rekrutmen/system/database/DB_driver.php
Line Number: 691
The Model
//insert data batch
public function save_batch($data){
return $this->db->insert_batch('agenda', $data);
}
The Controller
$no_agenda = $_POST['no_agenda'];
$no_batch = $_POST['no_batch'];
$nama_pelamar = $_POST['nama_pelamar'];
$alamat = $_POST['alamat'];
$no_hp = $_POST['no_hp'];
$data = array();
$data['users'] = $this->db->get_where('users', ['username' =>
$this->session->userdata('username')])->row_array();
$index = 0;
foreach($no_agenda as $no_agenda){
array_push($data, array(
'no_agenda'=>$no_agenda,
'no_batch'=>$no_batch[$index],
'nama_pelamar'=>$nama_pelamar[$index],
'alamat'=>$alamat[$index],
'no_hp'=>$no_hp[$index],
$data['users']
));
$index++;
}
$sql = $this->Agenda_model->save_batch($data);//save data