Skip to content

Instantly share code, notes, and snippets.

View gruff1991's full-sized avatar

Grant Spooner-Roberts gruff1991

  • Rugby Warwickshire
View GitHub Profile
@gruff1991
gruff1991 / class.database.php
Last active April 17, 2016 18:04 — forked from jonashansen229/class.database.php
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOST";
private $_username = "USERNAME";
private $_password = "PASSWORD";