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). [i]Thanks in advance.[/i] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Apr-20 20:06 UTC
Re: 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).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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ast Jay
2010-Apr-20 20:16 UTC
Re: Can I access another apps mysql database with my rails app?
Philip Hallstrom 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 :) Would you know if it is easy enough to share sessions with a forum app such as vbulletin? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Apr-20 20:32 UTC
Re: Re: Can I access another apps mysql database with my rails app?
On Apr 20, 2010, at 1:16 PM, Ast Jay wrote:> Philip Hallstrom 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 :) > > 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ast Jay
2010-Apr-20 20:47 UTC
Re: Re: Can I access another apps mysql database with my rails app?
Philip Hallstrom wrote:> On Apr 20, 2010, at 1:16 PM, Ast Jay 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. > > -philipI can live with access to the db for now - long-term plan is to move everything to rails. Thanks again for the replies. Ast. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.