I am a newbie in PHP programming. Here is my code :
class AdminActions extends DBManager{
public function loginUser($username, $password){
$dbh = $this->getConnection();
$smt = $dbh->prepare("SELECT count(1) FROM admin WHERE admin_name=:username AND admin_password=:password");
$smt->bindValue(':username', $username);
$smt->bindValue(':password', $password);
$count = $smt->fetchColumn();
return $count;
}
}
I am not able to return the value of $count. There is no error to be displayed (no output). I would like to have answers containing the function fetchColumn()
. Thank you in advance.