hi there I create this function to find password in a table if username is there!
but I got this error:
protected function checkLogin()
{
$conn = $this->connectDB();
$password = mysqli_real_escape_string($conn, trim($_SESSION["password"]));
$username = mysqli_real_escape_string($conn, trim($_SESSION["username"]));
$conn = $this->connectDB();
$record = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM profile WHERE email = '".$username."' OR cellphone = '".$username."' OR username = '".$username."'"));
if ($conn->error)
{
echo $conn->error;
$conn->close();
return false;
}
$record = $record['password'];
$conn->close();
if($this->matchPasswords($record['password']))
return true;
return false;
}
error:
( ! ) Warning: Illegal string offset 'password' in F:\wamp\www\myweb\libs\core.php on line 383
what is my wrong?