Hi.
In the pdo reference at http://it.php.net/manual/it/function.pdostatement-rowcount.php to find the number of rows affected by a SELECT statement you have to
use a query with a COUNT .
class LoginModel extends UserModel{
public function __construct($db){
parent::__construct($db);
}
public function isUser($name,$password){
$sql= "SELECT COUNT(user_ID) FROM users WHERE user_name=:name
&& user_password=MD5(:password) && user_confirm='1' LIMIT 1";
$sth= $this->db->prepare($sql);
$excute= array(':name'=>$name,':password'=>$password);
$sth->execute($excute);
return (bool)$sth->fetchColumn();
}
}
Is it the best way ? :o
Is there other way to get that ?
Bye.