1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-06-06 17:26:36 +02:00
Lexiconga/backend/Db.php

14 lines
389 B
PHP
Raw Normal View History

2017-12-24 12:00:45 -07:00
<?php
class Db {
private $dbh;
function _construct() {
$this->dbh = new PDO('mysql:host=localhost;dbname=lexiconga;charset=utf8', 'root', 'password');
$this->dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
}
public function query ($query, $params = array()) {
$stmt = $this->dbh->prepare($query);
$stmt->execute($params);
return $stmt;
}
}