0

I am trying to obtain the data inputted from the form and add it to the database. I get this error

enter image description here Here is my method to insert the data:

 protected function setUser($username, $firstname, $lastname, $email, $password)
{
    $sql = 'INSERT INTO userslogin (username, fistname,lastname ,email,password) VALUES (?,?,?,?,?);';

    $stmt = $this->connect()->prepare($sql);

    $hashedPwd = password_hash($password, PASSWORD_DEFAULT);
    if(!$stmt->execute(array($username,$firstname, $lastname , $email , $hashedPwd))){
        $stmt = null;
        header("location:index.php?error= no execution");
        exit();
    }
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149

0 Answers0