title: Codeigniter delete row from db
body: <p>Just want to delete row from db table by passing id. Please help me to pass id from the view correctly. Any help will be highly appreciated. Please let me know if any detailed information is needed so that I can provide it.</p>
  
  <p>Here is my Model:</p>
  
  <pre><code>public function did_delete_row($user_id){ 
  
  $query = $this-&gt;db-&gt;get_where('users',array('user_id' =&gt; $user_id));
  
      if ($query-&gt;num_rows() == 1) {
  
      if ($this-&gt;db-&gt;delete('users',array('user_id','email','name','city'))) 
  
          {return true;}
  
          else
  
          {return false;}
      } else {return false;}
  
                  }
  </code></pre>
  
  <p>Here is My view:</p>
  
  <pre><code>&lt;a href="&lt;?php echo site_url('admin/delete_row/'.$user_id);?"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>Here is My controller:</p>
  
  <pre><code>  public function delete_row($user_id) {
  
          $this-&gt;load-&gt;model("model_admin");
          $this-&gt;model_admin-&gt;did_delete_row($user_id);
  
          }
  </code></pre>