1

Please I am stucked in solving the above error. I have seen related questions but I can figure out how to handle it. Your help will be highly appreciated.

    public function checkAllowedIp() {
    global $pdo;
    $check = $pdo->prepare("SELECT * FROM Allowedips WHERE ip = :ip");
    $check->bindParam("ip", $this->getIp());  //line 62
    $check->execute();

    return ($check->rowCount() > 0);
}
Gill Hetti
  • 41
  • 5
  • https://stackoverflow.com/questions/1179874/what-is-the-difference-between-bindparam-and-bindvalue - If doesn't make sense to use `bindParam()` here. – Álvaro González Dec 04 '21 at 13:10

1 Answers1

1

Thanks I have gotten the code to work see below:

    public function checkAllowedIp() {
    global $pdo;
    $check = $pdo->prepare("SELECT * FROM Allowedips WHERE ip = :ip");
    $jik = $this->getIp();
    check->bindParam('ip',$jik);  //line 62
    $check->execute();

    return ($check->rowCount() > 0);
}
Gill Hetti
  • 41
  • 5