ruby sql select 查询语句用法

作者:袖梨 2022-06-25

ruby sql select 查询语句用法

require 'mysql教程'

m = Mysql.new("localhost","ruby","secret","maillist")
r = m.query("SELECT * FROM people ORDER BY name")
r.each_hash do |f|
  print "#{f['name']} - #{f['email']}"
end

相关文章

精彩推荐