Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. require 'mysql2'
  2.  
  3. client = Mysql2::Client.new(host: 'localhost', username: 'root', password: 'prepolac1964')
  4.  
  5. sql = 'select NOW() as timestamp'
  6.  
  7. result = client.query(sql)
  8.  
  9. result.each do |row|
  10. puts row['timestamp']
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement