Re: functions newbie

2002-07-22 Thread A Taylor
The reason this doesnt do what you expect it to do is because you are calling your function, which is then executing your SQL command and returning the first recordset. You are doing this over and over again - instead you should have some sort of loop in your function that loops through ALL the

Re: functions newbie

2002-07-22 Thread Shawn
Hello Charlie, [snip] > === > > This is my function attempting to do the same thing(?). > > sub Comment() { > > my( $sth ); > > $sth = $dbh->prepare("SELECT comment from dbtable > where com

functions newbie

2002-07-22 Thread Charlie Farinella
I'm trying to get a grip on functions. I want to connect to a database, execute a SELECT statement, and print each line where the criteria is met. This does what I want. my $comment; while ( $comment = $sth->fetchrow_array) { print "$comment\n"; } ===