1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-05-10 12:11:16 +02:00
Lexiconga/backend/Db.php

14 lines
No EOL
389 B
PHP

<?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;
}
}