Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$count_sent=0; $count_received=0; $count_nviewed=0; $sql = "SELECT * FROM table1 WHERE day = '$d' AND month = '$m_num' and + year = '$y' "; $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; while ($pointer = $sth->fetchrow_hashref) { $count_sent++; if (my $status = $pointer->{'status'} eq "2") { $count_received++;} if (my $status = $pointer->{'status'} eq "1") { $count_nviewed++;} } #Running this it find one entry based on my date as 06/24/2004 print "My results: $count_nviewed<br>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Counter Issue
by iburrell (Chaplain) on Jun 25, 2004 at 16:44 UTC | |
|
Re: Counter Issue
by pbeckingham (Parson) on Jun 25, 2004 at 15:33 UTC | |
by Anonymous Monk on Jun 25, 2004 at 15:47 UTC | |
|
Re: Counter Issue
by Mercio (Scribe) on Jun 25, 2004 at 16:21 UTC |