This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Symfony 1.4 - Query external MySQL database
Symfony 1.4 - Query external MySQL database [message #103038] Sat, 24 July 2010 21:33 Go to next message
aam1r  is currently offline aam1r
Messages: 2
Registered: July 2010
Junior Member

I am trying to query an external MySQL database in my class but can't seem to figure out how to do so. I am using Propel and I have previously used Propel::getConnection() to make custom queries, however, only to the database that it is connected to.

Is there any way I can do this by using built-in Symfony plugins?

Re: Symfony 1.4 - Query external MySQL database [message #103041 is a reply to message #103038 ] Sun, 25 July 2010 00:12 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Yes, just add more connections into your databases.yml, and make the necessary reference in the schema.yml that you wish to use the second database. This link will become obvious if you open up these files as they are presently.

Then when you access the new db objects, it will connect to the secondary database automatically.

Remember Palestine
Previous Topic:Problem with i18n default_culture
Next Topic:How to know which field of a form is invalid?
Goto Forum:

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software