here is another attempt....

code:

require 'mysql'

begin
dbh = Mysql.new('root', 'user12', '34klq*', 'mydb')
puts dbh.get_server_info
rs = dbh.query'SELECT VERSION()'
puts rs.fetch_row

ensure
  dbh.close if dbh
end


Result:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require': cannot load such fil
e -- mysql (LoadError)
        from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
        from C:/Users/will/Notepad++/Databases/ruby_DBI.rb:1:in `<main>'

Any help would be appreciated thank you

-- 
Posted via http://www.ruby-forum.com/.