Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 4:00 am (All times are UTC )

 




Post new topic Reply to topic  [ 3 posts ] 
Author Message
Posted: Wed Feb 01, 2006 7:10 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 1:43 pm
Posts: 172
Not sure this is the best forum to drop this in on... but can't find one better suited.....

Can you link tables in seperate databases through the $database calls in Joomla (or MySQL) or does this have to be done seperately then link the results manually in php??

Follow-up question... in not able to do in Joomla 1.0.x will it be possible in Joomla 1.1.x (assuming MySQL can do it)??

Thanks,
Greg

_________________
Thanks,
Greg
CB Connector (CBC) Developer
CBC is a Community Builder Plugin to allow connection of Joomla! 1.0.x and Community Builder to a Categories Hierarchy, phpbb2, or phpbb3 forum.


Top
   
 
Posted: Wed Feb 01, 2006 7:18 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Not all databases support this feature, but most do.  MySQL support is version dependent, so you will need to check on this at MySQL.com .

The Joomla Database object will support this type of query in direct query mode, but with Joomla 1.1 moving toward database indepence (meaning you won't know what database engine the database object is using) it would probably not be a safe query to make without some form of test being conducted first.  You would need to test for database engine first, then execute one query if the engine supported it, another if it did not.

You would also need to make sure the users of this code knew that the SQL user Joomla used for its database connection would need to have access to the second database.

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 7:36 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 1:43 pm
Posts: 172
Thanks for the reply... I am mainly asking because I am involved in a CB plugin which connects phpBB with CB/Joomla and the question has come up several times about whether they have to reside in the same database or not.  For simple starting and ending sessions I would say the answer is no they don't need to be in the same database as we can do that to some extent without knowing where the DB is for phpBB (assuming we use its functions to start and stop the sessions... as it already knows where its table is located)...

But for importing and exporting users that is a little different story... Currently I have some queries that link up usernames and the link to assist in importing and exporting users (the user tables are seperate of each other)... I was doing some refactoring in the code the other night and was reminded after looking at my SQL statements that I did link them... so that prompted my question of how to write A query that could still link the tables if they were in seperate databases...  Something of the magnitude I am working on could be post linked in PHP outside of MySQL but I feel there would be a performance hit... potentially a sizable performance hit.

I think my MySQL is 4.0.29 using php 4.3.11 ...

Thanks,
Greg

_________________
Thanks,
Greg
CB Connector (CBC) Developer
CBC is a Community Builder Plugin to allow connection of Joomla! 1.0.x and Community Builder to a Categories Hierarchy, phpbb2, or phpbb3 forum.


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group