Я хочу вставить массив с массивом, как показано ниже, как это сделать, я также попытался вставить пакет, но он не работает.Вставить массив массива в codeigniter
array(4) {
["notification_title"]=>
array(2) {
[0]=>
string(35) "Hello! We have a good news for you."
[1]=>
string(35) "Hello! We have a good news for you."
}
["notification_message"]=>
array(2) {
[0]=>
string(81) "Now you can choose up to three types of advertisers that you wish to collaborate."
[1]=>
string(95) "Saat ini Anda sudah dapat memilih maksimal 3 (tiga) tipe iklan untuk dipasang pada mobil Anda. "
}
["notification_type"]=>
array(2) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
}
["notification_language"]=>
array(2) {
[0]=>
string(1) "1"
[1]=>
string(1) "2"
}
}
Я стараюсь, но это не работает
public function save($data) {
$this->db->insert_batch($this->table, $data);
}
Сообщение об ошибке
<h1>A Database Error Occurred</h1>
<p>Error Number: 1064</p><p>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 '0, 1) VALUES ('Hello! We have a good news for you.','Hello! We have a good news ' at line 1</p><p>INSERT INTO `ads_notification` (0, 1) VALUES ('Hello! We have a good news for you.','Hello! We have a good news for you.'), ('Now you can choose up to three types of advertisers that you wish to collaborate.','Saat ini Anda sudah dapat memilih maksimal 3 (tiga) tipe iklan untuk dipasang pada mobil Anda. '), ('1','1'), ('1','2')</p><p>Filename: C:/xampp/htdocs/movads/application/models/ModelNotifications.php</p><p>Line Number: 127</p> </div>
Это один мой print_r заявление
--- print_r заявление ---
Array
(
[notification_title] => Array
(
[0] => Keep your weekly minimum distance well monitor.
[1] => Keep your weekly minimum distance well monitor.
)
[notification_message] => Array
(
[0] => We found out that your driving is below weekly minimum distance. Keep driving safely and increase your driving distance to meet the minimum requirements.
[1] => Anda masih belum memenuhi target jarak minimum mingguan. Tetap menyetir dengan aman dan tingkatkan jarak mingguan Anda. Tetap semangat!
)
[notification_type] => Array
(
[0] => 2
[1] => 2
)
[notification_language] => Array
(
[0] => 1
[1] => 2
)
)
У вас есть сообщение об ошибке? – Swolschblauw
hi @Swolschblauw нет, сообщений об ошибках нет, но я хочу вставить с этим форматом массива, похоже, что с документами от CI –
hi @Swolschblauw update выше –