开发者

PHP Error Call to undefined function RecordCount()

开发者 https://www.devze.com 2023-04-02 09:38 出处:网络
I\'m fairly new to PHP and have been trying to make a simple login using PHP PDO. When I try and login it keeps throwing this error -Call to undefined function RecordCount(). My searching has provided

I'm fairly new to PHP and have been trying to make a simple login using PHP PDO. When I try and login it keeps throwing this error - Call to undefined function RecordCount(). My searching has provided no insight as to why this is happening. My code is below. Any insight into where to look or why this is happening would be appreciated. Thanks!

     <?php
        include_once '../utils/dbcon.php';

        $stmt = $dbc->prepare("SELECT username,password FROM users where username = ? AND password = ?");

if ($stmt->execute(array($_GET['username'],$_GET['password'])))
 {


   if ($stmt.RecordCount())
       {

        echo "record开发者_如何转开发 found";
       } 
   elseif(!$stmt.RecordCount())
           {
       echo "No records found";
       }

 }  


        ?>


Your syntax is wrong:

$stmt.RecordCount()

should be

$stmt->RecordCount()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号