Я попытался вставить несколько значений данных в базу данных MySQL с помощью codeigniter. Но это не работает < /p>
Я получил следующую ошибку
error
db error < /p>
INSERT INTO `allocated` (0, 1) VALUES ('1463104690','9443610181'), ('Timing-Device Piston','Pump element '), ('Bosch Germany','Bosch Germany'), ('17.07.2019','17.07.2019'), ('17.07.2019','17.07.2019'), ('Nigeria','Nigeria'), ('AGL-0014','AGL-0014'), ('302-05861181-19','302-05861181-19'), ('142417201432','142417201432'), ('84139100','84139100'), ('INDIA','JAPAN'), ('20','24'), ('',''), ('20','24'), ('10','14'), ('20',''), ('21.52','14.7'), ('',''), ('',''), ('',''), ('215.2','205.8'), ('0.056','0.136'), ('0.56','1.904'), ('',''), ('',''), ('',''), (), ('3785174','351715735'), ('xyz','abc')
Filename: D:/wamp/www/aal-stock/system/database/DB_driver.php
Line Number: 691
Controller:
function itemsallocated()
{
if($this->session->userdata('Username') != '')
{
$this->load->model("main_model");
$pn=$this->input->post('Part_Number');
$desc=$this->input->post('Description');
$brand=$this->input->post('From');
//$pfrom=$this->input->post('From');
$idate=$this->input->post('Date');
$impcode=$this->input->post('Import_License_Number');
$invused=$this->input->post('Invoice_Used');
$invno=$this->input->post('Invoice_Number');
$decno=$this->input->post('Declaration_Number');
$billno=$this->input->post('Bill_Number');
$hscode=$this->input->post('HS_Code');
$coo=$this->input->post('COO');
$qty=$this->input->post('Quantity');
$Stock_Rem=$this->input->post('Stock_Rem');
$Stock_Rem2=$this->input->post('Stock_Rem2');
$cart=$this->input->post('cart');
$Allocated=$this->input->post('Allocated');
$euro=$this->input->post('Price_in_Euro');
$usd=$this->input->post('Price_in_USD');
$aed=$this->input->post('AED');
$jpy=$this->input->post('JPY');
$value=$this->input->post('Value');
$wpp=$this->input->post('Wt_Per_Piece');
$twt=$this->input->post('Total_Wt');
$L=$this->input->post('L');
$B=$this->input->post('B');
$H=$this->input->post('H');
$Added_By=$this->input->post('Added_By');
$Cus_Name=$this->input->post('Cus_Name');
date_default_timezone_set('Asia/Dubai');
$ddate= date('d-m-Y H:i:s');
$data=array('Part_Number'=>$pn,
'Description'=>$this->input->post('Description'),
'From'=>$brand,
'Date'=>$idate,
'Import_License_Number'=>$impcode,
'Invoice_Used'=>$invused,
'Invoice_Number'=>$invno,
'Declaration_Number'=>$decno,
'Bill_Number'=>$billno,
'HS_Code'=>$hscode,
'COO'=>$coo,
'Quantity'=>$qty,
'Stock_Rem'=>$Stock_Rem,
'Stock_Rem2'=>$Stock_Rem2,
'cart'=>$cart,
'Allocated'=>$Allocated,
'Price_in_Euro'=>$euro,
'Price_in_USD'=>$usd,
'AED'=>$aed,
'JPY'=>$jpy,
'Value'=>$value,
'Wt_Per_Piece'=>$wpp,
'Total_Wt'=>$twt,
'L'=>$L,
'B'=>$B,
'H'=>$H,
'd_t'=>$ddate,
'Added_By'=>$Added_By,
'Cus_Name'=>$Cus_Name
);
$this->db->insert_batch('allocated', $data);
Подробнее здесь: https://stackoverflow.com/questions/576 ... flat-array
Можно ли использовать Codeigniter insert_batch () с плоским массивом? ⇐ Php
Кемеровские программисты php общаются здесь
1746648875
Anonymous
Я попытался вставить несколько значений данных в базу данных MySQL с помощью codeigniter. Но это не работает < /p>
Я получил следующую ошибку
error
db error < /p>
INSERT INTO `allocated` (0, 1) VALUES ('1463104690','9443610181'), ('Timing-Device Piston','Pump element '), ('Bosch Germany','Bosch Germany'), ('17.07.2019','17.07.2019'), ('17.07.2019','17.07.2019'), ('Nigeria','Nigeria'), ('AGL-0014','AGL-0014'), ('302-05861181-19','302-05861181-19'), ('142417201432','142417201432'), ('84139100','84139100'), ('INDIA','JAPAN'), ('20','24'), ('',''), ('20','24'), ('10','14'), ('20',''), ('21.52','14.7'), ('',''), ('',''), ('',''), ('215.2','205.8'), ('0.056','0.136'), ('0.56','1.904'), ('',''), ('',''), ('',''), (), ('3785174','351715735'), ('xyz','abc')
Filename: D:/wamp/www/aal-stock/system/database/DB_driver.php
Line Number: 691
Controller:
function itemsallocated()
{
if($this->session->userdata('Username') != '')
{
$this->load->model("main_model");
$pn=$this->input->post('Part_Number');
$desc=$this->input->post('Description');
$brand=$this->input->post('From');
//$pfrom=$this->input->post('From');
$idate=$this->input->post('Date');
$impcode=$this->input->post('Import_License_Number');
$invused=$this->input->post('Invoice_Used');
$invno=$this->input->post('Invoice_Number');
$decno=$this->input->post('Declaration_Number');
$billno=$this->input->post('Bill_Number');
$hscode=$this->input->post('HS_Code');
$coo=$this->input->post('COO');
$qty=$this->input->post('Quantity');
$Stock_Rem=$this->input->post('Stock_Rem');
$Stock_Rem2=$this->input->post('Stock_Rem2');
$cart=$this->input->post('cart');
$Allocated=$this->input->post('Allocated');
$euro=$this->input->post('Price_in_Euro');
$usd=$this->input->post('Price_in_USD');
$aed=$this->input->post('AED');
$jpy=$this->input->post('JPY');
$value=$this->input->post('Value');
$wpp=$this->input->post('Wt_Per_Piece');
$twt=$this->input->post('Total_Wt');
$L=$this->input->post('L');
$B=$this->input->post('B');
$H=$this->input->post('H');
$Added_By=$this->input->post('Added_By');
$Cus_Name=$this->input->post('Cus_Name');
date_default_timezone_set('Asia/Dubai');
$ddate= date('d-m-Y H:i:s');
$data=array('Part_Number'=>$pn,
'Description'=>$this->input->post('Description'),
'From'=>$brand,
'Date'=>$idate,
'Import_License_Number'=>$impcode,
'Invoice_Used'=>$invused,
'Invoice_Number'=>$invno,
'Declaration_Number'=>$decno,
'Bill_Number'=>$billno,
'HS_Code'=>$hscode,
'COO'=>$coo,
'Quantity'=>$qty,
'Stock_Rem'=>$Stock_Rem,
'Stock_Rem2'=>$Stock_Rem2,
'cart'=>$cart,
'Allocated'=>$Allocated,
'Price_in_Euro'=>$euro,
'Price_in_USD'=>$usd,
'AED'=>$aed,
'JPY'=>$jpy,
'Value'=>$value,
'Wt_Per_Piece'=>$wpp,
'Total_Wt'=>$twt,
'L'=>$L,
'B'=>$B,
'H'=>$H,
'd_t'=>$ddate,
'Added_By'=>$Added_By,
'Cus_Name'=>$Cus_Name
);
$this->db->insert_batch('allocated', $data);
Подробнее здесь: [url]https://stackoverflow.com/questions/57602318/can-codeigniters-insert-batch-be-used-with-a-flat-array[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия