From: Joseph Newton Date: 2008-03-30T15:40:06+09:00 Subject: Re: mysql database access! possible without rails? Hi Jeff, Thanks for the clear direction, particularly for the Windows users. Can you tell us where to find documentation for the mysql adapter? Joseph Newton Jeff Miller wrote: > This is what I do to interact with my MySQL database w/o rails: First > install the mysql gem (c:/> gem install mysql) > > require 'mysql' > db = Mysql.connect("localhost", "username", "password", "database_name") > @mysql_query = db.query("YOUR SQL STATEMENT") > > #~ to iterate over results: > while row = @mysql_query.fetch_row do > @field1 = row[0] > @field2 = row[1] > #~ etc... > > db.close > > I think you have to have an ODBC connection set up, though. You can get > it from MySQL's website. > > Good luck, > - Jeff Miller