From: Brian Candler Date: 2011-10-10T16:57:02+09:00 Subject: Re: Ruby and MySQl > That's why i think there's a problem in the dbh query. So now you need to take a divide-and-conquer approach to the problem. What do you see if you go into the mysql command prompt and type select * from condition_rating; select * from condition_rating where id in (1,2,3); If both these show the three rows you expect, then the data has been inserted correctly into your database. So you should be able to replicate your problem with a smaller program: require 'mysql' dbh = Mysql.real_connect("localhost", "root", "***", "test",3306) res = dbh.query("SELECT component, ID, rating FROM condition_rating where rating IN (1,2,3)") while row = res.fetch_row do puts row.inspect end Now, if that small program only shows one row, then clearly there is a problem in your use of the mysql API (and this means you have eliminated Sketchup from the problem). If the above program doesn't show the error, then you need to find out what other bit of your original program is causing the problem. A good way to do this can be to start with your original program and keep trimming bits out until the problem goes away. The aim is to find the smallest possible program which reproduces the problem. What you've written looks OK to me according to this article: http://www.kitebird.com/articles/ruby-mysql.html So you'll need to continue to dig like this until you can find what it is specifically that causes the problem. And if not, then you have a small test case which demonstrates the problem which you can take to the author or the mailing list specific to ruby mysql. You also need to report: * what operating system you're using * what version of ruby you're running * what version of ruby mysql you're using, and where you installed it from (e.g. from rubygems? from your system package manager?) * what version of the mysql client library you're using * what version of the mysql server you're talking to Regards, Brian. -- Posted via http://www.ruby-forum.com/.