Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Database
- {
- private
- $database,
- $dbhost = '', // usually localhost
- $dbname = '',
- $dbuser = '',
- $dbpass = ''
- ;
- public function __construct( )
- {
- $this->database = new mysqli( $this->dbhost, $this->dbuser, $this->dbpass, $this->dbname );
- if( $this->database->connect_errno)
- {
- die( "Failed to connect to MySQL: (" . $this->database->connect_errno . ") " . $this->database->connect_error );
- }
- }
- function get_connection( )
- {
- return $this->database;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement