I wanted a fast way to get data from mysql using ruby. after i installed the mysql gem it was really easy. This program gets all rows, but only displays the id,name and zip.
require “mysql”
dbh = Mysql.real_connect(”localhost”, “root”, “password”, “scottwork”)
res = dbh.query(”SELECT name,address,city,state,zip,email FROM contacts”)
while row = res.fetch_row do
id = row[0]
[...]

