From: Eric Schwartz Date: 2003-12-04T05:17:07+09:00 Subject: dbd/mysql returns nil rows? I find this very confusing. I'm trying to run a simple query using ruby DBI and MySQL, and for some reason, the dbd driver is returning nil instead of returning valid rows. It can't be an SQL error, or there would have been an exception thrown, right? So what am I doing wrong? Here's an irb transcript: irb(main):016:0> dbh = DBI.connect("DBI:mysql:testplan", "testplan", "testplan") => #, @trace_mode=2, @handle=#true}, @handle=#, @mutex=#>> irb(main):017:0> mysth = dbh.prepare("select * from #{CONFIG_TABLE} where #{CONFIG_PLATFORM} = ?") => #, @prepared=true, @trace_mode=2, @fetchable=false, @row=nil, @handle=#true}, @handle=#, @mutex=#>, @unbound={1=>0}, @result=["select * from test_config where tc_platform = ", nil], @arg_index=1, @sql="select * from test_config where tc_platform = ?">, @attr={}, @params=[], @handle=#, @parent=#true}, @handle=#, @mutex=#>, @mutex=#>, @cols=nil> irb(main):018:0> rows = mysth.execute(10) => [nil, nil, nil, nil, nil] Interestingly, it works fine with rows = dbh.execute("...",10) in irb, but in my application it gives the same result as the prepare/execute pair above. If you guys can help me figure out why irb is failing, then I can probably fix what's broken in the app. -=Eric -- Eric Schwartz email: emschwar@hp.com Hewlett-Packard Company Phone: +1 970 898 7443 Linux and Open Source Lab (LOSL)