Name: *

E-mail: *

Website:

Comment:

Gender: Female Male Other *

// public function create(): bool { // $query = "INSERT INTO " . $this->tableName . " // SET // title = :title, // author = :author, // publisher = :publisher"; // // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // // $this->title = $this->sanitize($this->title); // $this->author = $this->sanitize($this->author); // $this->publisher = $this->sanitize($this->publisher); // // $stmt->bindParam(':title', $this->title); // $stmt->bindParam(':author', $this->author); // $stmt->bindParam(':publisher', $this->publisher); // // if($stmt->execute()) { // $this->id_copy = (int)$conn->lastInsertId(); // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // } // public function update(): bool { // $query = "UPDATE " . $this->tableName . " // SET // title = :title, // author = :author, // publisher = :publisher // WHERE // id_copy = :id_copy"; // // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // // $this->title = $this->sanitize($this->title); // $this->author = $this->sanitize($this->author); // $this->publisher = $this->sanitize($this->publisher); // // $stmt->bindParam(':title', $this->title); // $stmt->bindParam(':author', $this->author); // $stmt->bindParam(':publisher', $this->publisher); // $stmt->bindParam(':id_copy', $this->id_copy); // // if($stmt->execute()) { // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // } // public function delete(): bool { // $query = "DELETE FROM " . $this->tableName . " WHERE id_copy = :id_copy"; // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // $stmt->bindParam(':id_copy', $this->id_copy); // // if($stmt->execute()) { // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // } // public function update(): bool { // $query = "UPDATE " . $this->tableName . " // SET // username = :username, // name = :name // WHERE // id_partner = :id_partner"; // // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // // $this->username = $this->sanitize($this->username); // $this->name = $this->sanitize($this->name); // // $stmt->bindParam(':username', $this->username); // $stmt->bindParam(':name', $this->name); // $stmt->bindParam(':id_partner', $this->id_partner); // // if($stmt->execute()) { // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // } // public function delete(): bool { // $query = "DELETE FROM " . $this->tableName . " WHERE id_partner = :id_partner"; // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // $stmt->bindParam(':id_partner', $this->id_partner); // // if($stmt->execute()) { // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // } // public function create(): bool { // $query = "INSERT INTO " . $this->tableName . " // SET // username = :username, // password = :password, // name = :name"; // // $conn = self::getConnection(); // $conn->exec("use library;"); // $stmt = $conn->prepare($query); // // $this->username = $this->sanitize($this->username); // $this->password = $this->sanitize($this->password, 'password'); // $this->name = $this->sanitize($this->name); // // $stmt->bindParam(':username', $this->username); // $stmt->bindParam(':password', $this->password); // $stmt->bindParam(':name', $this->name); // // if($stmt->execute()) { // $this->id_partner = (int)$conn->lastInsertId(); // return true; // } // printf("Error: %s.\n", $stmt->errorInfo()[2]); // return false; // }