mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-05-31 19:27:32 +00:00
Rename DataBase.php to database.php
This commit is contained in:
22
website/class/database.php
Normal file
22
website/class/database.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
class DataBase {
|
||||
|
||||
private $PDO;
|
||||
|
||||
public function __construct() {
|
||||
$this->PDO = new PDO("mysql:host=".DB_HOST."; dbname=".DB_NAME, DB_USER, DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
|
||||
}
|
||||
public function select($query, $bindings = []) {
|
||||
$STH = $this->PDO->prepare($query);
|
||||
$STH->execute($bindings);
|
||||
$result = $STH->fetchAll(PDO::FETCH_ASSOC);
|
||||
$result ??= false;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function query($query, $bindings = []){
|
||||
$STH = $this->PDO->prepare($query);
|
||||
return $STH->execute($bindings);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user