MySQL Forums
Forum List  »  Perl

DBD::mysql::st fetchrow_array failed: fetch() without execute()
Posted by: Tim Vantag
Date: February 05, 2007 12:50AM

Hi.

I noticed a strange problem in my program.

I have used my program for a months and it has been worked well.

Now I updatet packets (I used yum) and it updated these packets:

mysql.i386 5.0.27-1.fc5
perl-DBD-MySQL.i386 3.0007-1.fc5

Now When I run my program I get lot's of error messages.

DBD::mysql::st fetchrow_array failed: fetch() without execute()

And example here it comes:

$sql_query_string="SELECT id FROM tcaseex WHERE case=? AND tr=?";

#Here I call function
$exist = &select_from_database($sql_query_string,$tid,$trid);

#And here id the function
sub select_from_database {
    my ( $sql_string, @parameters ) = @_;
    $sth = $db_conn->prepare($sql_string) or die "Can't prepare statement: $DBI::errstr";  
    $sth->execute( @parameters )  or die "Can't execute statement: $DBI::errstr";        
    my @a = $sth->fetchrow_array;
    while (my $_f = $sth ->fetchrow_array){
    push(@a, $_f);
    }
  $sth->finish();
 return unless defined wantarray;                                                            
  return wantarray ? @a : "@a"; 
}

So what's wrong now ?
Why I now started to get error messages ?

Options: ReplyQuote


Subject
Written By
Posted
DBD::mysql::st fetchrow_array failed: fetch() without execute()
February 05, 2007 12:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.