title: Query in codeigniter model doesn't seem to work
body: <p>This function in my model is intended to validate if the student user inserted a correct credential. I doubt it's the structure of my query that is problematic. Here's my code segment:</p>
  
  <p><strong>index.php</strong> (view)</p>
  
  <pre><code>            &lt;form method="POST" action="&lt;?php echo site_url('home/validateStud');?&gt;" name="formvalidate"&gt;
                &lt;div class="form-group"&gt;
                  &lt;input type="text" class="form-control" id="idnum" placeholder="ID Number"/&gt;
                  &lt;br&gt;
                  &lt;input type="password" class="form-control" id="pass" placeholder="PASSWORD"/&gt;
                  &lt;br&gt;
                  &lt;button type="submit" class="btn btn-primary" style="width: 100%;" onclick="" name="submit2" value="&lt;?php echo $this-&gt;uri-&gt;uri_string(); ?&gt;" id="validated"&gt;Validate&lt;/button&gt;
                &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p><strong>home.php</strong> (controller)</p>
  
  <pre><code>public function validateStud()
  {
    $submit=$this-&gt;input-&gt;post('submit2');
    $studentId=$this-&gt;input-&gt;post('idnum');
    $password=$this-&gt;input-&gt;post('pass');
    $this-&gt;load-&gt;model('StudentModel', 'Student', true);
  
    $valid=$this-&gt;Student-&gt;checkValidation($studentId, $password);
    if (isset($_POST['submit2']) &amp;&amp; $valid) {
      redirect('student/index', true);
    }
    else
    {
      $indication = $this-&gt;initializeDialogBox('Record not found', ' Student Validation', 'fa-primary', 'fa-user', 'danger');
      $this-&gt;session-&gt;set_flashdata('message', $indication);
      redirect($this-&gt;input-&gt;post('submit2'));  
    }
  }
  </code></pre>
  
  <p><strong>studentmodel.php</strong> (model)</p>
  
  <pre><code>public function checkValidation($studentId, $password)
      {
          $query="SELECT * from STUDENT WHERE STUDENT_ID='".$studentId."' AND PASSWORD='".$password."'";
          $queryValid=$this-&gt;db-&gt;query($query)-&gt;row();
  
          if($queryValid-&gt;num_rows == 1)
          {
              return true;
          }
          else
              return false;
      }
  </code></pre>
  
  <p><code>initializeDialogBox()</code> is a declared function by me, so don't mind it. Thanks in advance for those who can help me. :)</p>