Skip to content

Instantly share code, notes, and snippets.

View mehdi9500's full-sized avatar

Mehdi Yaghoubi mehdi9500

View GitHub Profile
<?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";
@shakyShane
shakyShane / Gallery.php
Last active November 8, 2017 15:35
Create a simpe PHP Photo Gallery with Pagination
@mloberg
mloberg / watermark.html
Created June 23, 2011 18:40
Watermark PHP
<img src="watermark.php?watermark=watermark.png&src=test.jpg" />