I'm doing this project for school and I've come across this issue and I was wondering how I could fix it, username is in varchar, so is password but department is in enum
public function createUserAccount($username,$password,$department){
if($this->userExists($username)){
return "USER_ALREADY_EXISTS";
}
else{
$pass_hash = password_hash($password,PASSWORD_BCRYPT,["cost"=>8]);
$pre_stmt = $this->con->prepare("INSERT INTO `user`(`id`, `username`, `password`, `department`) VALUES (?,?,?,?)");
$pre_stmt->bind_param("sss",$pass_hash,$username,$department);
$result = $pre_stmt->execute() or die($this->con->error);
if($result){
return $this->con->insert_id;
}
else{
return "some error";
}
}