From: Brian Candler Date: 2011-10-10T02:13:05+09:00 Subject: Re: Ruby and MySQl blue orchid wrote in post #1025823: > Sketchup.active_model.entities.each {|entity| > if entity.entityID == 2349 and c=='2' > entity.material = "green" > break > end > } > > if entity.entityID == 2349 and c=='3', then that entity in google > sketchup changes to color green. But previously, you asserted that the problem was in the dbh.query line which did a select query - which could not have updated the database and therefore is completely independent from the above code. Now you're saying it's a problem with Sketchup, which I guess is some sort of third-party library. So if you are having a problem using dbh to insert or select into Mysql tables, then show it here. Otherwise I suggest you take your query to the Sketchup mailing list, if there is one. > But if I use c==2 or c==1 instead of c==3, then the entity does not > change its color. Note that there is a difference between 2 and "2" in Ruby. Try using 'inspect' to show this. e.g. puts row[0].inspect puts row[1].inspect etc. -- Posted via http://www.ruby-forum.com/.