From: Idealone Ideally on 28 Jan 2010 07:05 Albert Schlef wrote: > Idealone Ideally wrote: >> Hi Guys, >> Ruby imposes several way[s] of [...] using ruby code. > > That's certainly an interesting observation. Guys, I eventually got it working, just adding gem 'dbi'.. require "rubygems" gem "dbi" require "dbi" def connect_to_mysql() puts "\nConnecting to MySQL..." me = DBI.connect("dbi:Mysql:DBname:localhost", "root", "") query = me.prepare("SELECT * FROM browsers where id > ?") query.execute(0) while row = query.fetch() do puts row end Thanks -- Posted via http://www.ruby-forum.com/.
First
|
Prev
|
Pages: 1 2 Prev: can't update and install gem Next: Why does `source .bashrc` complain "command not found"? |