QuickBooks/Driver/Sql/Mysql.php
protected function _connect($host, $port, $user, $pass, $db, $new_link, $client_flags)
	{
		if ($port)
		{
			$this->_conn = mysql_connect($host . ':' . $port, $user, $pass, $new_link, $client_flags) or die('host: ' . $host . ', user: ' . $user . ', pass: XXXX, mysql_error(): ' . mysql_error());
		}
		else
		{
			$this->_conn = mysql_connect($host, $user, $pass, $new_link, $client_flags) or die('host: ' . $host . ', user: ' . $user . ', pass: XXXX, mysql_error(): ' . mysql_error());
		}
			
		// Select the correct database
		$tmp = mysql_select_db($db, $this->_conn) or die(mysql_error());
		
		// Support UTF-8 chars
		mysql_query("SET NAMES 'utf8'", $this->_conn);
		
		/*
		static $connections = array();
		$connections[] = $user . ':' . $pass . '@' . $host . ':' . $port . '/' . $db;
		mysql_query("INSERT INTO quickbooks_log ( msg, log_datetime ) VALUES ( 'MySQL connection #" . count($connections) . ", " . print_r($connections, true) . "', NOW() )", $this->_conn) or die(mysql_error());
		*/
		
		return $tmp;
	}
protected function _connect($host, $port, $user, $pass, $db, $new_link, $client_flags)
	{
		if ($port)
		{
			$this->_conn = mysql_connect($host . ':' . $port, $user, $pass, $new_link, $client_flags) or die('host: ' . $host . ', user: ' . $user . ', pass: XXXX, mysql_error(): ' . mysql_error());
		}
		else
		{
			$this->_conn = mysql_connect($host, $user, $pass, $new_link, $client_flags) or die('host: ' . $host . ', user: ' . $user . ', pass: XXXX, mysql_error(): ' . mysql_error());
		}
			
		// Select the correct database
		$tmp = mysql_select_db($db, $this->_conn) or die(mysql_error());
		
		// Support UTF-8 chars
		mysql_query("SET NAMES 'utf8'", $this->_conn);
		
		/*
		static $connections = array();
		$connections[] = $user . ':' . $pass . '@' . $host . ':' . $port . '/' . $db;
		mysql_query("INSERT INTO quickbooks_log ( msg, log_datetime ) VALUES ( 'MySQL connection #" . count($connections) . ", " . print_r($connections, true) . "', NOW() )", $this->_conn) or die(mysql_error());
		*/
		
		return $tmp;
	}
Connect to the database

@param string $host				The hostname the database is located at
@param integer $port				The port the database is at
@param string $user				Username for connecting
@param string $pass				Password for connecting
@param string $db				The database name
@param boolean $new_link			TRUE for establishing a new link to the database, FALSE to re-use an existing one
@param integer $client_flags		Database connection flags (see the PHP/MySQL documentation)
@return boolean