Skip to content

Instantly share code, notes, and snippets.

View returnoz's full-sized avatar

Adrian Espinosa returnoz

View GitHub Profile
@Itrulia
Itrulia / SmashingConf Oxford 2016 Talks.md
Last active July 17, 2016 20:15
SmashingConf Oxford 2016 Talks
<?php
class Db
{
private $_connection;
private static $_instance; //The single instance
private $_host = DB_HOST;
private $_username = DB_USER;
private $_password = DB_PASSWORD;
private $_database = DB_DB;
@jonashansen229
jonashansen229 / class.database.php
Last active June 20, 2023 08:41
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 = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";