Probably because your $dbh->do(..) statement is silently failing and you're not checking for success or failure.
When it fails, $sth2 gets assigned "undef" instead of a valid statement handle, and that's why you get an error when you call fetchrow_array() as a method of $sth2.
Dave
In reply to Re: cannot retrieve value from select statement
by davido
in thread cannot retrieve value from select statement
by francisongsw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |