You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
551 B
28 lines
551 B
<?php
|
|
|
|
class Connection
|
|
{
|
|
|
|
private $connection;
|
|
|
|
private $query;
|
|
|
|
public function __construct(string $host, string $username, string $password, string $dbname)
|
|
{
|
|
$connection=mysqli_connect($host, $username, $password,$dbname);
|
|
}
|
|
|
|
public function executeQuery(string $query): void
|
|
{
|
|
$this->query=mysqli_query($this->getConnection(),$query);
|
|
}
|
|
|
|
public function getResults(): array
|
|
{
|
|
return $this->query;
|
|
}
|
|
|
|
public function getConnection(){
|
|
return $this->connection;
|
|
}
|
|
} |