On Fri, 24 Oct 2003 23:08:10 -0700 (PDT) [EMAIL PROTECTED] wrote: > I'm messing with this code so much that I can't trace it down. But I > will tell you that I get a huge number, 4698765..., when I do a > $sth->rows()
Search for "rows" in http://search.cpan.org/dist/DBI/DBI.pm . rows() can't be called unless the variable $sth is a blessed statement handle object. If you can call $sth->rows() without a fatal error, you have at least established that $sth is still a blessed DBI statement handle. > I do believe the $dbh connection is still good but something is wrong > with the $sth. Which means I get no rows fetched when I am expecting. It would be easier for us to judge if you provided a sample of the code that demonstrates the issue. > btw, I'm using redhat 9/mysql canned installation. That's a start. Up to now I had no idea which RDBMS you were using. > Sorry to post like this but every now and then I run into this error > which causes the code to break upon the call $sth->fetchrow_array(). What error is in $sth->errstr? The same value is in $DBI::errstr until another DBI method resets it. Unless you check, you have no clue what's going wrong. > Thanks for following-up, I'm not trying to prove anything. Just trying > to figure out what is happening. Most likely I have a bad reference > somewhere because I'm not either passing the handler around correctly. Checking for errors at each point would make it possible to do more than randomly speculate. See http://search.cpan.org/dist/DBI/DBI.pm#Simple_Examples for examples of explicit and automatic error checking of several method calls. -- Mac :}) ** I usually forward private questions to the appropriate mail list. ** Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.
