Location: PHPKode > projects > SystemTracker > serialtracker/include/dbinfo.class.inc
<?

class dbinfo
{

var $s_connect;

	function serial_db_connect()
	{
                $hostname = "localhost";
                $username = "";
                $password = "";
                $dbname   = "";

		$this->s_connect = null;
                $this->s_connect = mysql_connect($hostname, $username, $password);
		if(!$this->s_connect)
		{
			print "Connection to database failed: host, user, or password incorrect, or db down.\n<br>\n";
		}

		mysql_select_db("$dbname") 
			or die ("Cannot connect to selected database.\n");
	}

	function serial_db_close()
	{
		mysql_close($this->s_connect)
			or die ("Unable to close selected database.\n");
	}
}
?>
Return current item: SystemTracker