title: Can not insert records into database in CodeIgniter
body: <p>I am beginner in CodeIgniter. I want to insert records in database. Here is my view file. I save view file as a <code>register.php</code> and my model file as <code>register_insert.php</code> and controller file as <code>register.php</code> and my table name in mysql is "register".</p>
  
  <p>View</p>
  
  <pre><code>&lt;?php $this-&gt;load-&gt;view('layot/header'); ?&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Register&lt;/title&gt;
    &lt;style&gt;
      td {
     border:none;
    }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;form method="POST" action="register"&gt;
  &lt;table border="1" align="center"&gt;
    &lt;tr&gt;
      &lt;td&gt;User Name : &lt;input type="text" name="u_nm"&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td&gt;Password : &lt;input type="text" name="pwd"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;E-Mail: &lt;input type="text" name="eid"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Contact No : &lt;input type="text" name="cno"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Mobile No : &lt;input type="text" name="mbo"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan="2" align="center"&gt;&lt;input type="submit" name="submit" value="Register"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/html&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This is my controller file..
      
  
  <pre><code>    public function index()
      {
          if(isset($_POST['submit']))
          {
              $data = array(
              'u_nm' =&gt; $this-&gt;input-&gt;post('u_nm'),
              'pwd' =&gt; $this-&gt;input-&gt;post('pwd'),
              'eid' =&gt; $this-&gt;input-&gt;post('eid'),
              'cno' =&gt; $this-&gt;input-&gt;post('cno'),
              'mbo' =&gt; $this-&gt;input-&gt;post('mbo'),
               );
              $this-&gt;register_insert-&gt;form_insert($data);
          }
          $this-&gt;load-&gt;view('register');
      }
  
    }
  ?&gt;
  </code></pre>
  
  <p>This is my model file..</p>
  
  <pre><code>&lt;?php
  class Register extends CI_Model
  {
  
     function __construct() {
         parent::__construct();
     }
     function form_insert($data){
         $this-&gt;db-&gt;insert('register', $data);
     }
  }
  ?&gt;
  }
  
  ?&gt;
  </code></pre>