get_last_error(); trigger_error("Database does not exist", E_USER_ERROR); die(); } //echo 'Creating new instance of db class.'; self::$instance[$dbname] = new DB($db_conf[$dbname]); } return self::$instance[$dbname]; } // -------------------------------------------------------------------------- /** * Returns the last error from the database * * @return string */ public function get_last_error() { $error = array(); if (isset($this->statement)) { $error = $this->statement->errorInfo(); } else { $error = $this->errorInfo(); } $code = $error[0]; $driver_code = $error[1]; $message = $error[2]; // Contain the content for buffering ob_start(); include(MM_APP_PATH.'/views/errors/error_db.php'); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; } } // End of db.php