All pastes #133128 Raw Edit

Anonymous

public text v1 · immutable
#133128 ·published 2006-08-15 17:43 UTC
rendered paste body
module Examples

class Db < Cerise::RequestHandler
  def handle(request, response)
    application.with_db_connection("db/Mysql") { |dbh|
      sth = dbh.prepare('select `id`, `created`, `xml` from `log` order by id desc limit 50')
      sth.execute

      data = []
      while row = sth.fetch do
        data.push({ :id => row["id"], :xml => row["xml"], :created1 => row["created"] })
      end

      { :log => data }
    }
  end
end

end