Я хотел бы вставить данные этого массива в дб, используя insert_batch () codeigniter
$data = Array (
[0] => Array
(
[e_purpose] => blank purpose data on row 2
[e_phase] => blank phase data on row 2
[e_carmaker] => please input a valid and related carmaker on row 2
[e_carline] => blank carline data on row 2
[table] => Expense Budget
[row] => 2
[section] => FINANCE
)
[1] => Array
(
[e_purpose] => blank purpose data on row 3
[e_phase] => please input a valid and related phase on row 3
[table] => Expense Budget
[row] => 3
[section] => FINANCE
)
)
, и вот мой запрос на вставку:
$this->db->insert_batch('t_error', $data);
, и я получил это ошибка:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: database/DB_query_builder.php
Line Number: 1542
Backtrace:
File: D:\ONNE\OTHERS\_CODING_PROGRAMMING\XAMPP\htdocs\bulus-ci\application\models\Excel_model.php
Line: 21
Function: insert_batch
File: D:\ONNE\OTHERS\_CODING_PROGRAMMING\XAMPP\htdocs\bulus-ci\application\controllers\Excel.php
Line: 125
Function: insertError
File: D:\ONNE\OTHERS\_CODING_PROGRAMMING\XAMPP\htdocs\bulus-ci\index.php
Line: 315
Function: require_once
Произошла ошибка базы данных
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Array' at line 1
INSERT INTO `t_error` () VALUES ('blank carline data on row 2','please input a valid and related carmaker on row 2','blank phase data on row 2','blank purpose data on row 2',2,'FINANCE','Expense Budget'), Array
Filename: D:/ONNE/OTHERS/_CODING_PROGRAMMING/XAMPP/htdocs/bulus-ci/system/database/DB_driver.php
Line Number: 691
Как я могу это исправить, Примечание: я не хочу использовать цикл / итерацию