in reply to Re: Perl database access
in thread Perl database access
$comment_sth->execute($id) or die "Couldn't execute comment query: ".$ +DBI::errstr; my @comment_row; while (@comment_row = $comment_sth->fetchrow_array) { my ($speedtrap_id,$comment_id,$comment_text,$comment_date,$commenter) += @comment_row; if(@comment_row){ print <<EOF; <tr> <td colspan="2" bgcolor="#E6ECF0">$comment_text</td> </tr> EOF } else { print <<EOF; <tr> <td colspan="2" bgcolor="#E6ECF0">There are no comments from others fo +r this speedtrap.</td> </tr> EOF }
But it always executes the the first condition. I've tried all kinds of ways to get the condition to work but I can't figure it out. Your help is greatly appreciated.
Thanks
Adam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl database access
by ikegami (Patriarch) on Sep 23, 2004 at 18:02 UTC | |
by awohld (Hermit) on Sep 23, 2004 at 19:59 UTC |