<?php
class bDBresult {
private $result;
public function __construct($res) {
$this->result = $res;
}
public function num_rows() {
return $this->result->num_rows;
}
public function next_row() {
return $this->result->fetch_assoc();
}
}
class bDB {
private static $conf;
private $conn;
public static function set_conf_file($dbconf_path) {
self::$conf = parse_ini_file($dbconf_path);
}
public function __construct() {
$this->conn = new mysqli(
self::$conf['db.host.address'],
self::$conf['db.user.admin.name'],
self::$conf['db.user.admin.password'],
self::$conf['db.bibliotecando.name']
);
}
public function send_query($coms) {
return new bDBresult($this->conn->query($coms));
}
}
?>