Location: PHPKode > projects > ArticleSetup > ArticleSetup-v1-1/upload/comments/classes/DB.class.php
<?php
class DB {

	protected $db_name;
	protected $db_user;
	protected $db_pass;
	protected $db_host;
	
	function __construct($db_config) {
		
		$this->db_name = $db_config["db_name"];
		$this->db_host = $db_config["db_host"];
		$this->db_user = $db_config["db_user"];
		$this->db_pass = $db_config["db_pass"];
		
	}

	/* Open a connection to the database */
	public function connect() {
		
		$connection = mysql_connect($this->db_host, $this->db_user, $this->db_pass);
		if (!$connection)
			return false;
		$database = mysql_select_db($this->db_name);
		if (!$database)
			return false;
		return $connection;
		
	}
	
}
?>
Return current item: ArticleSetup