From: Phil Pan Date: 2008-01-18T02:13:35+09:00 Subject: howto insert data into a database? Hi all, I can't seem to figure this out and I would appreciate any help. I have a ruby script that I want to cron on a server. This script will scrape data from a website and then insert the data into a MySQL database. I have successfully scrapped the data however I cannot figure out how to insert the data into the MySQL database From command prompt I figured out that that this is the syntax to insert a file into a database: mysql -u root -pqwerasdf ridespot --execute="LOAD DATA LOCAL INFILE "c:/new.txt\" INTO TABLE foo LINES TERMINATED BY '\r\m'" How do I run this command in ruby? I have already tried: system "command" and 'command' But it doesn't work. Thanks for your response! -Phil -- Posted via http://www.ruby-forum.com/.