Advertisement
GWibisono

salah logic

Nov 3rd, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2. public function insert() {
  3.     $res = $this->modelweb->InsertData('siswa', array(
  4.         "nama"      => $this->input->post('nama'),
  5.         "alamat"    => $this->input->post('alamat'),
  6.         "kelas"     => $this->input->post('kelas'),
  7.                 "no_hp"     => $this->input->post('no_hp'),
  8.                 "jk"            => $this->input->post('jk'),
  9.     ));
  10. //------------- harusnya return TRUE or FALSE bukan 1,2,3,4,5 !!!
  11.     */ supaya kondisi ini di kirim ke view bagaimana?
  12.     if($res){  // >= 1) {
  13.         //redirect('web');
  14.     $result=$this->load->view('web',$param,true);
  15.     $result=json_decode($result);
  16.     }
  17.     else {
  18.     redirect('web','reload');
  19.     }
  20. }
  21.  
  22. //=====================web========
  23. //----------kirim semua variabel ke array
  24. $ar=array('data'=>'bla bla');
  25. echo json_encode($ar);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement