Category: Български

MySQL и Ruby

  #!/usr/bin/ruby
  require "mysql"
  hostname= "localhost"
  username= "root"
  password= "password"
  database= "mysql"
  # връзка с MySQL. Връща MySQL обект
  my= Mysql.new(hostname, username, password, database)
  # Подготовка
  st= my.prepare("SELECT VERSION()")
  # Изпълнение
  st.execute
  # Вземане на резултата
  result= st.fetch
  # показване на резултата
  puts result.to_s

Retrieved from "http://forge.mysql.com/wiki/MySQL_%D0%B8_Ruby"

This page has been accessed 3,351 times. This page was last modified 22:06, 12 June 2007.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...