title: Undefined variable id in CodeIgniter
body: <p>I have this todo list project.</p>
  
  <h3>My model</h3>
  
  <pre><code>class Model_lists extends CI_Model {
  
  function Model_list(){
      parent::__construct();
  }
  
  function list_get($id){
      $this-&gt;load-&gt;database();
      $query = $this-&gt;db-&gt;get_where('lists', array('id'=&gt;$id));
      return $query-&gt;row_array();
  }
  </code></pre>
  
  <h3>My Controller</h3>
  
  <pre><code>public function view_list($id){
      $this-&gt;load-&gt;model('model_lists');
      $data["query"] = $this-&gt;model_lists-&gt;list_get($id);
      $this-&gt;load-&gt;view('lists/view_list',$data);
  }
  </code></pre>
  
  <h3>List view</h3>
  
  <pre><code>&lt;?php
   echo $query['list_by'];
  ?&gt;
  </code></pre>
  
  <p>However, when I access the view I get 2 PHP errors </p>
  
  <p>1) Message: Missing argument 1 for Lists::view_list() <br />
  2) Message: Undefined variable: id</p>
  
  <p>This is how I call the list:</p>
  
  <pre><code>&lt;a class="view_list" href="&lt;?php echo site_url("lists/view_list?lid={$row-&gt;list_id}");?&gt;"&gt;&lt;i class="icon-eye"&gt; &lt;/i&gt;&lt;/a&gt;
  </code></pre>