title: problem in inserting entries into my database
body: <p>I have created a view page for login and upload but when i press the submit button it does not get uploaded into my database..</p>
  
  <p>I have used insert() command.</p>
  
  <p>this is my controller,i have called model beforehand  using 
               $this->load->model('upanel_model');  now i want to code such that whenever a user presses submit button the data gets inserted in the database.</p>
  
  <pre><code>       public function upload_post(){
              $config['upload_path']    =   './uploads/'; 
              $config['allowed_types']  =   'gif|jpg|png';
              $config['max_size']       =   '1000';
              $config['max_width']      =   '1024';
              $config['max_height']     =   '768';
              $config['file_name']      =   '$pdfname';  
              $this-&gt;load-&gt;library('upload',$config); 
      if(!$this-&gt;upload-&gt;do_upload('userfile')){
              $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());                
          }     
       else{
              $data1 = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
              $data = $this-&gt;upload-&gt;data('full_path');
              $pdfType = $data1['upload_data']['file_ext'];
              $pdf_link = $pdfName.$pdfType;
              $table = 'register';
              $data['email']=$this-&gt;post('email');
              $data['password']= $this-&gt;post('password');
              $data['file_path']=$pdf_link;
              $data2 = $this-&gt;upload-&gt;data('full_path');
              $userdata=$this-&gt;$model_name-&gt;insert($table,$data);
       if($userdata){
              $data_response['status']=1;
              $data_response['msg']="Successfully inserted details";
  
              $this-&gt;response($data_response);
                  } else{                        
                       $data_response['status']=0;
                       $data_response['msg']="Unable To insert details";
                       $this-&gt;response($data_response);
             }    
      }
     public function upload_get(){
      $this-&gt;load-&gt;view('view');       
      }
  </code></pre>
  
  <p>this is my model named upanel_model.php which inserts the data</p>
  
  <pre><code>       &lt;?php
          function insert($table,$data){
          $this-&gt;db-&gt;insert($table,$data);
          return $this-&gt;db-&gt;insert_id();
         }
         ?&gt;
  </code></pre>
  
  <p>this is my view named view.php that call my upload api</p>
  
  <pre><code>      &lt;body&gt;   
        &lt;?php echo form_open_multipart('uPanel/do_upload'); ?&gt;
        &lt;div class = "header"&gt;
            &lt;h1&gt;Login Now&lt;/h1&gt;
        &lt;/div&gt;
        &lt;form method= "post" action= "upload"&gt;
        &lt;div class="input-group"&gt;
            &lt;label&gt;email&lt;/label&gt;
            &lt;input type="text" name="email" &gt;
        &lt;/div&gt;
        &lt;div class ="input-group"&gt;
                &lt;label&gt;Password&lt;/label&gt;
                &lt;input type="text" name="password"&gt;  
        &lt;/div&gt;
        &lt;div class = "input-group"&gt;
        &lt;input type="submit" class ="btn" name="login_now" value="submit" &gt;                                
          &lt;/div&gt; 
        &lt;p&gt;   NOT MEMBER? SIGN UP 
        &lt;/p&gt;    
        &lt;input type="file" name="userfile" size="90" /&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;input type="submit" value="upload" /&gt;
        &lt;/body&gt;
  </code></pre>