Hello!
Ive gotten this error:
Fatal error: Call to a member function num_rows() on a non-object in
/home4/cultured/public_html/application/models/Login_model.php on line
12
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home4/cultured/public_html/application/controllers/Main.php:1)
Filename: core/Common.php
Line Number: 564
Backtrace:
A PHP Error was encountered
Severity: Error
Message: Call to a member function num_rows() on a non-object
Filename: models/Login_model.php
Line Number: 12
Backtrace:
This is my code within my model:
<?php
class Login_model extends CI_Model {
public function log_in_correctly() {
$this->db->where('username', $this->input->post('username'));
$this->db->where('password', $this->input->post('password'));
$query = $this->db->get('cultured_codeignite');
if ($query->num_rows() == 1)
{
return true;
} else {
return false;
}
}
}
?>
Im trying correct the query row but dont know how to do it, Been researching but there are various awnsers and dont know which one is correct. Help if you can.
,
Mekaboo