title: Failed insert data to database with codeigniter
body: <p>Not showing error, but failed to insert
  and in my database the data is not inserted.
  I'm newbie with CI.</p>
  
  <p>this is my
  <strong>Controller</strong></p>
  
  <pre><code>class Register extends CI_Controller {
  
      function __construct(){
          parent::__construct();
          $this-&gt;load-&gt;model('m_register');
      }
  
      public function index()
      {
          $this-&gt;load-&gt;view('user/register');
      }
  
      public function daftar_akun(){
  
          $username = $this-&gt;input-&gt;post('reg_username');
          $password = $this-&gt;input-&gt;post('reg_password');
          $email = $this-&gt;input-&gt;post('email');
          $no_telp = $this-&gt;input-&gt;post('no_telp');
          $nama_lengkap = $this-&gt;input-&gt;post('nama_lengkap');
          $no_ktp = $this-&gt;input-&gt;post('no_ktp');
          $alamat = $this-&gt;input-&gt;post('alamat');
          $role_id = 3;
          $status = 0;
  
          $data = array(
              'username'=&gt; $username,
              'password' =&gt; $password,
              'email' =&gt; $email,
              'no_telp' =&gt; $no_telp,
              'nama_lengkap' =&gt; $nama_lengkap,
              'no_ktp' =&gt; $no_ktp,
              'alamat' =&gt; $alamat,
              'role_id' =&gt; $role_id,
              'status' =&gt; $status
              );
          $this-&gt;m_register-&gt;register_akun($data);
          redirect(base_url("login"));
      }
  }
  </code></pre>
  
  <p>this is my <strong>Model</strong></p>
  
  <pre><code>class M_register extends CI_Model{
  
      function register_akun($data){
          $this-&gt;db-&gt;insert('user',$data);
      }
  }
  </code></pre>