Re: Ruby Mysql inset variable
Hi All,
I got simple solution
require 'mysql'
my_array= ["google.com","yahoo.com"]
db = Mysql::new("localhost", "root", "", "new_development")
my_array.each do |a|
puts a
b = a.collect{|x| x = "'" + x + "'"}
puts b
c = b.join(",")
puts c
sql = "INSERT INTO sites VALUES (3,#{c},0,0);"
db.query(sql)
end
Regards,
P.Raveendran
RF,Chennai,
http://raveendran.wordpress.com
Subject
Written By
Posted
Re: Ruby Mysql inset variable
August 22, 2008 10:08PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.