Can I access another apps mysql database with my rails app?

Sorry if the answer is obvious (nube alert) but would it be possible for
me to access the DB of a php app using a mysql database, from within my
Rails app?

I want to install my (php) forums in forum.site.com, and my main site
(using rails) will be at the root, site.com - so could I list the latest
forum thread, in my Rails side of the site, by simply accessing the
mysql database directly?

Guess I would just need to give it username/pw for the db, and the mysql
query?

Is it going to be easy enough to do, or should I stick with a full php
solution (can’t drop PHP as we need a full featured forum like vB).

Thanks in advance.

mysql database directly?

Guess I would just need to give it username/pw for the db, and the
mysql
query?

Is it going to be easy enough to do, or should I stick with a full php
solution (can’t drop PHP as we need a full featured forum like vB).

That’s one way and would work fine. If the tables in the other
database are at least somewhat AR friendly you can also setup the
connection in database.yml (ie. with a name of say “phpforums”) and
then create a model and use establish_connection to point it to the
phpforums database.

If you’re careful about how you use it, it should work fine.

Philip H. wrote:

mysql database directly?

Guess I would just need to give it username/pw for the db, and the
mysql
query?

Is it going to be easy enough to do, or should I stick with a full php
solution (can’t drop PHP as we need a full featured forum like vB).

That’s one way and would work fine. If the tables in the other
database are at least somewhat AR friendly you can also setup the
connection in database.yml (ie. with a name of say “phpforums”) and
then create a model and use establish_connection to point it to the
phpforums database.

If you’re careful about how you use it, it should work fine.

Thanks Philip :slight_smile:

Would you know if it is easy enough to share sessions with a forum app
such as vbulletin?

On Apr 20, 2010, at 1:16 PM, Ast J. wrote:

Would you know if it is easy enough to share sessions with a forum app
such as vbulletin?

Unlikely to be easy. But if the cookies are available and you’re
willing to parse the information you could do whatever you want.

-philip

Philip H. wrote:

On Apr 20, 2010, at 1:16 PM, Ast J. wrote:

Would you know if it is easy enough to share sessions with a forum app
such as vbulletin?

Unlikely to be easy. But if the cookies are available and you’re
willing to parse the information you could do whatever you want.

-philip

I can live with access to the db for now - long-term plan is to move
everything to rails.

Thanks again for the replies.

Ast.