Note that there are some explanatory texts on larger screens.

plurals
  1. POCode igniter : Call to a member function num_rows() on a non-object
    primarykey
    data
    text
    <p>i have developed a app in codeigniter on localhost ...the app works fine .. then i uploaded the app into temporary server ... and after login into the admin panel i am getting this error..but if i run the same app in localhost it works fine ...</p> <p>error</p> <pre><code> Fatal error: Call to a member function num_rows() on a non-object in /home/u520606051/public_html/application/models/loginmodel.php on line 9 </code></pre> <p>this my Model :</p> <pre><code>function validate($data) { $query = $this-&gt;db-&gt;get_where('users', $data); if($query-&gt;num_rows() == 1) { return true; } } </code></pre> <p>controller </p> <pre><code>function verifyUser() { //getting parameters from view $data = array( 'username' =&gt; $this-&gt;input-&gt;post('username'), 'password' =&gt; $this-&gt;input-&gt;post('password') ); $this-&gt;load-&gt;model('loginModel'); $query = $this-&gt;loginModel-&gt;validate($data); if ($query) { //if the user c validated //data variable is created becx we want to put username in session $data = array( 'username' =&gt; $this-&gt;input-&gt;post('username'), 'is_logged_in' =&gt; true ); $this-&gt;session-&gt;set_userdata($data); redirect('sessionController/dashboard_area'); } else { $this-&gt;index(); } } </code></pre> <p><strong>file name Of Modal:</strong> </p> <pre><code> loginmodel.php class Loginmodel extends CI_Model </code></pre> <p><strong>file name of Controller</strong></p> <pre><code>loginController.php class LoginController extends CI_Controller </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload