gpt4 book ai didi

javascript - SQLSTATE[01000] : Warning: 1265 Data truncated for column 'id_paket' at row 1

转载 作者:行者123 更新时间:2023-12-02 21:32:12 26 4
gpt4 key购买 nike

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'id_paket' at row 1 (SQL: insert into tbl_pesanan (id_paket, kode_bmn, kode_unit, jenis_barang, kuantitas, satuan_ukuran, status_pesanan) values (18,18, 1010101002,1010101002, 1001,1001, ASus,ASus, 6,6, UNit,UNit, 1))

发生什么事了,你能帮帮我吗?

public function store_pesanan(request $request,$id){
if(!Session::get('login')){
return redirect('/login')->with('alert','Kamu harus login dulu');
}
else{
DB::table('tbl_paket')
->where('id_paket',$id)
->update(['status_paket' => $request->status_paket]);

$data = new ModelPesanan();
$data->id_paket = implode(',', $request->input('id_paket'));
$data->kode_bmn = implode(',', $request->input('kode_bmn'));
$data->kode_unit = implode(',', $request->input('kode_unit'));
$data->jenis_barang = implode(',', $request->input('jenis_barang'));
$data->kuantitas = implode(',', $request->input('kuantitas'));
$data->satuan_ukuran = implode(',', $request->input('satuan_ukuran'));
$data->status_pesanan = $request->get('status_pesanan');
$data->save();

Alert::success('Sukses!', 'Berhasil Menambahkan Pesanan!');
return redirect ('/daftar_paket');
}
}

enter image description here

最佳答案

问题似乎是您尝试在 id_paket 字段中插入一个太长的值。检查 id_paket 的类型和大小,并与您的查询发送的内容进行比较:18,18

关于javascript - SQLSTATE[01000] : Warning: 1265 Data truncated for column 'id_paket' at row 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60593346/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com