Page 1 of 1

Multiple MySQL connections in modules

Posted: Mon Mar 10, 2008 12:59 pm
by bzzik
Hi guys!

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");
and close it with mysql_close($con nect);
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.

Re: Multiple MySQL connections in modules

Posted: Tue Mar 11, 2008 1:57 pm
by bzzik
Anyone? :(

Re: Multiple MySQL connections in modules

Posted: Tue Mar 11, 2008 10:13 pm
by Rogue4ngel
Here's a method to connect to another db. Perhaps it will help:
http://dev.joomla.org/component/option, ... _database/

Re: Multiple MySQL connections in modules

Posted: Wed Mar 12, 2008 1:41 pm
by bzzik
Is it for 1.0 or for 1.5?