[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: mysql and ruby 1.8

Sabyasachi Mustafi

11/17/2003 8:54:00 AM

You may try this. 1. You have to connect to Mysql with dbh2. Then prepare, execute and fetchFollowing is a method from our project in the PHED department (Govt. of West Bengal, India) def take_blockname #METHOD FOR TAKE BLOCK NAME FROM THE TABLE BLOCK dbh = DBI.connect($varDataBase,$varUser,$varPass) #dbh = DBI.connect('dbi:Mysql:PHE1:100.100.100.1','test','') sql = "SELECT block_name FROM BLOCK where dcode = '#{$blockDCode}';" #print sql dbh.prepare(sql) tb = dbh.execute(sql) str = tb.fetch() get_block = str.to_a while(str!=nil) str = tb.fetch() get_block<<str.to_a end dbh.disconnect #print get_block $cmbBlockBName.entries = get_block #SENDING BLOCK NAMES TO THE COMBO BOX end #ENDING METHOD FOR TAKING BLOCK NAMESOn Mon, 17 Nov 2003 Matt Lawrence wrote :>On Mon, 17 Nov 2003, Stefan Schmiedl wrote:>> > Does anybody have the ingredients at hand to get a working> > connection between Ruby 1.8 and (MySQL and PostgreSQL) on> > a Windows XP box?>>Install Linux? :-)>>Actually, I suggest you look at the ruby-dbi package.>>-- Matt>Boredom isn't the root of _all_ evil, but it tries.>>