Fatal error: Uncaught Error: Call to a member function fetch() on boolean

ساخت وبلاگ
I have executed the sql in phpmyadmin and it returns 1 for an email address, yet execute() seems to returning a boolean and I'm getting the above error. Not sure how or why?
PHP Code:

function CountEmailQuery()
            {
                try
                {
                
$sql $this->link->prepare("SELECT count(Email) FROM table WHERE Email = :Email");
                
$sql->bindValue(":Email",$_POST['Email']);
                
$count $sql->execute();
                }
                catch(
Exception $e)
                {
                    echo 
$e->getMessage();
                }
                return 
$count;
            } 

PHP Code:

 $Count $pdo->CountEmailQuery();
 try{
 while(
$row $Count->fetch(PDO::FETCH_ASSOC))
{
foreach(
$row as $count)
{
echo 
$count;
}
}
}
catch(
Exception $e)
{
echo 
$e->getMessage();


Any help appreciated.
CodingForums...
ما را در سایت CodingForums دنبال می کنید

برچسب : نویسنده : codingforums بازدید : 218 تاريخ : جمعه 29 دی 1396 ساعت: 20:42