Section 2 finished.
This commit is contained in:
parent
13490cdad2
commit
c96119c47f
2 changed files with 12 additions and 4 deletions
|
|
@ -8,9 +8,9 @@ class Database {
|
|||
$dsn = 'mysql:'.http_build_query($config, '', ';');
|
||||
$this->connection = new PDO($dsn, $username, $password, [PDO::ATTR_DEFAULT_FETCH_MODE=> PDO::FETCH_ASSOC]);
|
||||
}
|
||||
public function query($query) {
|
||||
public function query($query, $params = []) {
|
||||
$statement = $this->connection->prepare($query);
|
||||
$statement->execute();
|
||||
$statement->execute($params);
|
||||
return $statement;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue