Column 'date' cannot be null

hallo semuanya, saya ingin bertanya. apabila saya input data ke database melalui web yang saya buat tidak bisa kenapa ya? sedangkan saya sudah mengisi formnya tp ngga keinput dan kebacanya tetap null. mungkin dari kalian ada bisa membantu?

A Database Error Occurred Error Number: 1048

Column 'date' cannot be null

INSERT INTO `alatlab` (`date`, `codeAlat`, `barcode`, `namaAlat`, `jumlah`, `jumlahTersedia`, `kondisi`, `spesifikasi`, `lokasiAlat`, `tipeAlat`, `catatanAlat`, `fotoAlat`, `harga`) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

controller:

function input_BHP(){ $date = $this->input->post('date'); $codeAlat = $this->input->post('codeAlat'); $barcode = $this->input->post('barcode'); $namaAlat = $this->input->post('namaAlat'); $jumlah = $this->input->post('jumlah'); $jumlahTersedia = $this->input->post('jumlahTersedia'); $kondisi = $this->input->post('kondisi'); $spesifikasi = $this->input->post('spesifikasi'); $lokasiAlat = $this->input->post('lokasiAlat'); $tipeAlat = $this->input->post('tipeAlat'); $catatanAlat = $this->input->post('catatanAlat'); $fotoAlat = $this->input->post('fotoAlat'); $harga = $this->input->post('harga');

$data = array( 'date' => $date, 'codeAlat' => $codeAlat, 'barcode' => $barcode, 'namaAlat' => $namaAlat, 'jumlah' => $jumlah, 'jumlahTersedia' => $jumlahTersedia, 'kondisi' => $kondisi, 'spesifikasi' => $spesifikasi, 'lokasiAlat' => $lokasiAlat, 'tipeAlat' => $tipeAlat, 'catatanAlat' => $catatanAlat, 'fotoAlat' => $fotoAlat, 'harga' => $harga ); $this->DBBhp->insertData('alatlab',$data); redirect('listBHP/daftarBHP'); }

thank you

avatar dheakhrnns
@dheakhrnns

6 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

3 Jawaban:

ss aja bang controller sama viewnya

avatar siffiyan
@siffiyan

49 Kontribusi 4 Poin

Dipost 6 tahun yang lalu

name attribut nya di html nya udah bener gan?

 <input name="date">
<input name="codeAlat">
<input name="barcode">
<input name="namaAlat">

avatar keccikun
@keccikun

364 Kontribusi 196 Poin

Dipost 6 tahun yang lalu

solved guys thank you, saya kurang method="post" di viewnya :)

avatar dheakhrnns
@dheakhrnns

6 Kontribusi 0 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban