SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to access a MySQL database

    I'm a Ruby & MySQL newbie. I need to write a Ruby script that can access a MySQL database. I have several books on Ruby & MySQL but they don't sufficiently address the problem I need to solve. Can anyone post some sample code that does what I want, or direct me to some documentation that will get me going?
    Thanks....

  2. #2
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't used ruby outside of rails to go use a database, but you might want to take a look at this:

    http://www.kitebird.com/articles/ruby-dbi.html
    If you give someone a program,
    you will frustrate them for a day;
    if you teach them how to program,
    you will frustrate them for a lifetime.

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent! Thank you for pointing me in the right direction. I'll be trying this out soon.
    Peter V.

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also use ActiveRecord outside Rails.

  5. #5
    SitePoint Enthusiast crag's Avatar
    Join Date
    Apr 2003
    Location
    Ft. Lauderdale, FL
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2 View Post
    You can also use ActiveRecord outside Rails.
    I was just gonna point that out. There's a tutorial at http://www.oreillynet.com/lpt/a/7051. Takes you through building a console app with Ruby and ActiveRecord (no Rails).

    Ruby does have other uses besides Rails.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •