I am using the following query in a codeigniter controller.
$u -> where('us_email_id', $username);
$u -> where('us_password', $password1);
$details = $u -> get();
$total = count($details);
echo $total; echo "<br>";
echo count($details);
In the above code, $ u is the name of the object for the User class for the user datamapper, where the table name in my database is "users". I want to see how many rows are returned after the query is completed. "$ total" always displays 1, even if the user ID and password do not match. I want if the number of rows returns 1, then "ok" else "something is wrong." I know its basic, but if someone knows this, please help me. Thanks in advance.
source
share