I almost finished my own small module for joomla 1.0, but at the end I faced a problem

The thing is that in my module I use MySQL connection to another DB (not to DB in which joomla installed) in such manner:
Code: Select all
$connect = mysql_connect($mysql_addr,$mysql_user,$mysql_pass) or die("Failed to connect to mySQL server");
mysql_select_db($mysql_db, $connect) or die("Could not select database");
but all other joomla modules after mine stops working correctly - they try to use DB form my module.
How can I resolve it? Is it possible to use custom MySQL connections in modules and if yes, how it open and close connections correctly?
Thanks in advance.