title: pass a post value from view to controller to model, and back to controller in code igniter
body: <p>I'm creating a login form with Codeigniter, and I have a controller that collects the inputs from the form, then I want to check to make sure what the user entered is in the database, so I'm collecting those values in the post and want to send them to the model for the database connection. Then if the results are in the database I want to send something back to the controller with a yes or no and then I can go from there. I'm kind of stuck, but this is what I have so far:</p>
  
  <p>The controller:</p>
  
  <pre><code>function do_login()
  {
      $login = $this-&gt;input-&gt;post('Login');
      $pwd = md5($this-&gt;input-&gt;post('Passwd'));
  
  
  }
  </code></pre>
  
  <p>The Model: </p>
  
  <pre><code>function check_login()
  {
  
      $sql = $this-&gt;db-&gt;query("SELECT * FROM members WHERE loin = '?' AND password = '?'", array(//POST stuff goes in here));
      return $sql-&gt;result();
  
  }
  </code></pre>
  
  <p>I'm not sure how to pass the data to the model, and then back to the controller.</p>
  
  <p>Any help would be great!
  Thanks!</p>