Я получаю эту ошибку, и я понятия не имею, почему я ее получаю, мой код работает, но все равно наличие ошибки означает, что что-то не так.Не могли бы вы помочь мне?
![enter image description here](https://i.stack.imgur.com/uN7W7.png)
ЗДЕСЬ:
addDepartment (name:string, location:string):Observable<any> { return this.http.post(this.depCreate,{ "name": name, "location": location}, httpOptions); }
Код базы данных здесь.Я надеюсь, что это поможет вам исправить это:
function create(){
// query to insert record
$query = "INSERT INTO
" . $this->table_name . "
JSON.stringify({ "name": name, "location": location})";
// echo $query;
// prepare query
$stmt = $this->conn->prepare($query);
if (!$stmt)
var_dump($this->conn->errorInfo());
// sanitize
$this->name=htmlspecialchars(strip_tags($this->name));
$this->location=htmlspecialchars(strip_tags($this->location));
// bind values
$stmt->bindParam(":name", $this->name);
$stmt->bindParam(":location", $this->location);
// execute query
if($stmt->execute()){
return true;
}