JackTheRussel
Programmer
Hi.
I have function which runs SQL-sentences and returns a
table where the results are
This is ok. Return-sentence returns values to me.
Now I would like to know how many records I get.
and I add one variable into function.
$howMany = $sth->execute( @parameters );
Now how I get both of these values out (return-sentence).
I have function which runs SQL-sentences and returns a
table where the results are
Code:
sub select {
my ( $sql_sentence, @parameters ) = @_;
$sth = $db_connection->prepare($sql_sentence);
$sth->execute( @parameters );
my @data = $sth->fetchrow_array;
while (my $_f = $sth ->fetchrow_array){
push(@data, $_f);
}
$sth->finish();
return @data; #Return records
$sth->finish();
}
This is ok. Return-sentence returns values to me.
Now I would like to know how many records I get.
and I add one variable into function.
$howMany = $sth->execute( @parameters );
Now how I get both of these values out (return-sentence).