これは私の接続クラスです。
class Database {
private $host;
private $port;
private $dbname;
private $username;
private $password;
function __construct($host, $port, $dbname, $username, $password) {
$this->host = $host;
$this->port = $port;
$this->dbname = $dbname;
$this->username = $username;
$this->password = $password;
try {
$conn = new PDO("pgsql:host=$this->host port=$this->port dbname=$this->dbname", "$this->username", "$this->password");
echo "PDO connection object created";
}
catch(PDOException $e) {
echo $e->getMessage();
}
}
}
$db = new Database('host','5432','eu','eu','eu');
SQLインジェクションから安全な正しいQUERYクラスを行うのを手伝ってもらえますか?
ありがとう!