Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'Database.interface.php';
- class MysqlBase implements Database {
- private $host, $user, $pass, $db, $base;
- public function __construtct($host, $user, $pass, $db) {
- $this->host = $host;
- $this->user = $user;
- $this->pass = $pass;
- $this->db = $db;
- }
- public function open() {
- $dsn = sprintf('mysql:host=%s;dbname=%s', $this->host, $this->db);
- $base = new PDO($dsn, $this->user, $this->pass);
- }
- public function close() {
- $this->base = null;
- }
- public function execute($strSQL) {
- $stmt = $this->base->prepare($strSQL);
- $stmt->execute();
- return $stmt;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement