Php无法创建用户

I'm new to create REST API on my Raspberry. I installed in it MySql and I want to create the signup api. I found a tutorial on the web and I followed it. I'm having some issue by create user in my table by using the API I wrote. Here's the structure of my user_usr table:

enter image description here

I create a PHP class to connect to the DB like so:

<?php
class Database {
    private $host = "localhost";
    private $db_name = "my_db_name";
    private $username = "root";
    private $password = "my_password";
    public $conn;
    function getConnection() {
        $this->conn = null;
        try {
            $this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password);
        } catch(PDOException $exception) {
            echo "Connection error: " . $exception->getMessage();
        }
        return $this->conn;
    }
}
?>

Then I create the user.php class like so:

<?php
class User {
    private $conn;
    private $table_name = "user_usr";
    public $id_usr;
    public $name_usr;
    public $surname_usr;
    public $email_usr;
    public $password_usr;
    public function __construct($db){
        $this->conn = $db;
    }
    function create() {
        $query =  "INSERT INTO " . $this->table_name . "
            SET
                name_usr = :name,
                surname_usr = :surname,
                email_usr = :email,
                password_usr = :password";
        $stmt = $this->conn->prepare($query);
        $this->name_usr=htmlspecialchars(strip_tags($this->name_usr));
        $this->surname_usr=htmlspecialchars(strip_tags($this->surname_usr));
        $this->email_usr=htmlspecialchars(strip_tags($this->email_usr));
        $this->password_usr=htmlspecialchars(strip_tags($this->password_usr));
        $stmt->bindParam(':name', $this->name_usr);
        $stmt->bindParam(':surname', $this->surname_usr);
        $stmt->bindParam(':email', $this->email_usr);
        $password_hash = password_hash($this->password_usr, PASSWORD_BCRYPT);
        $stmt->bindParam(':password', $password_hash);
        if($stmt->execute()){
            return true;
        }
        return false;
    }
}
?>

And I create the class to create user (create_user.php) like so:

<?php
header("Access-Control-Allow-Origin: http://localhost/api3/");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");

include_once 'config/database.php';
include_once 'objects/user.php';

$database = new Database();
$db = $database->getConnection();

$user = new User($db);

$data = json_decode(file_get_contents("php://input"));

$user->name_usr = $data->name;
$user->surname_usr = $data->surname;
$user->email_usr = $data->email;
$user->password_usr = $data->password;

if ($user->create()) {
    http_response_code(200);
    echo json_encode(array("message" => "User was created."));
} else {
    http_response_code(400);
    echo json_encode(array("message" => "Unable to create user."));
}
?>

When I tri to run the API with Postman at this address: http://my_raspberry_ip/api/create_user.php I see that the query fails and I don't know why. In Postman I get an error 400:

enter image description here

It seems that the row $stmt->execute() in file user.php for some reason fails and it return false so the server shows me the 400 error. Anyone has an idea why it fails? Can anyone help me to find a solution for this issue? Thank you!