Skip to content

Instantly share code, notes, and snippets.

View agscs's full-sized avatar
🏠
Working from home

PHPkiller agscs

🏠
Working from home
View GitHub Profile
@johnmorris
johnmorris / gist:8135167
Created December 26, 2013 15:41
A simple database class using mysqli prepared statements in PHP.
<?php
if ( !class_exists( 'DB' ) ) {
class DB {
public function __construct($user, $password, $database, $host = 'localhost') {
$this->user = $user;
$this->password = $password;
$this->database = $database;
$this->host = $host;
}
protected function connect() {