PHP Error Call to undefined function RecordCount()
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()
精彩评论