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
  • 89,708
  • 20
  • 100
  • 143
Max98
  • 1

0 Answers0