Welcome Guest, Not a member yet? Register   Sign In
Query error in Model
#1

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.

Heart Heart ,
Mekaboo
Reply


Messages In This Thread
Query error in Model - by Mekaboo - 05-12-2019, 08:26 PM
RE: Query error in Model - by InsiteFX - 05-13-2019, 03:03 AM
RE: Query error in Model - by Mekaboo - 05-13-2019, 11:32 AM
RE: Query error in Model - by Wouter60 - 05-13-2019, 08:05 AM
RE: Query error in Model - by Mekaboo - 05-13-2019, 01:01 PM
RE: Query error in Model - by Wouter60 - 05-13-2019, 01:37 PM
RE: Query error in Model - by Mekaboo - 05-13-2019, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB