Skip to content

Instantly share code, notes, and snippets.

@Addvilz Addvilz/gist:3024731
Created Jun 30, 2012

Embed
What would you like to do?
MySQLi extends
<?php
/**
* SQL base class, extends MySQLi
*
*/
class Sql extends MySQLi{
/**
* MySQLi __construct override with autoconnect
*
* @return void
*
*/
public function __construct() {
global $_CONFIG;
parent::__construct($_CONFIG['sql']['host'], $_CONFIG['sql']['user'], $_CONFIG['sql']['pass'], $_CONFIG['sql']['default_db']);
if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.