in reply to Re: Can not figure out cause of error.
in thread Can not figure out cause of error.

But the select statment only returns one row. And it is the exact same select statment used in another script which works fine. Which is why I am confused as to why that exact select statment works in one script and not this one.
  • Comment on Re^2: Can not figure out cause of error.

Replies are listed 'Best First'.
Re^3: Can not figure out cause of error.
by jZed (Prior) on Aug 13, 2005 at 18:23 UTC
    Do you still get the error if you put $sth->finish() after $sth->fetchrow_array()?
      The error does go away when I add $sth -> finish; so at this point I am just trying to figure out why this error appears in one script and not the other when the same code is used.
        I couldn't guess what's going on without seeing all the scripts, but one possibility is that in some scripts the $sth goes out of scope before the call to $dbh->disconnect. Another possibility is that the data is in a different state when you perform the queries. BTW, I believe what you are seeing is a warning, not an error. I surmise this because you aren't using RaiseError. I'd recommend using RaiseError on general principles. If you really want to track down exactly why you get the warning, you might google for the text of the warning and the name of your DBMS, e.g. -- ODBC "disconnect invalidates"
Re^3: Can not figure out cause of error.
by Eagle_f91 (Acolyte) on Aug 13, 2005 at 11:41 UTC
    Opps forgot to login on that post sorry.