on Thu, 20 Jun 2002 22:30:36 GMT, [EMAIL PROTECTED] (Maureen E Fischer) wrote:
> I am stuck on a bug in my perl cgi program that uses a mysql > database. In executing the following code I am getting a message > in the dump that the > fetch failed --fetch () without execute () > [...] > > $sql = "SELECT clientcode FROM clientemployee > WHERE clientemployee.empid=?"; > $sth = $dbh->prepare($sql); > $sth->execute("$validemp"); > my $sites = $sth->fetchall_arrayref; > print DBI::dump_results($sth); > print "\n\n"; The 'dump_results' method itself fetches the records from $sth. Since you already did this yourself (by calling the fetchall_arrayref method), you have to either re-execute your query, or remove the fetchall_arrayref call. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]