Skip to content

Instantly share code, notes, and snippets.

@raphaelcosta
Created July 23, 2010 06:28
Show Gist options
  • Save raphaelcosta/487098 to your computer and use it in GitHub Desktop.
Save raphaelcosta/487098 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mysql'
db = Mysql.new('localhost', 'root', '', 'ngforms_development')
begin
insert_new_entry = db.prepare "INSERT INTO entry_values(value_string, value_integer, value_decimal) VALUES (?, ? ,?)"
insert_new_entry.execute 'aizatto', '20', '20.23'
insert_new_entry.close
statement = db.prepare "SELECT * FROM entries WHERE merged = ?"
statement.execute '0'
statement.fetch
statement.close
ensure
db.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment