A couple of valid solutions have been shown, here's another take on the problem (I consider this to be a more natural way of solving it):
my $rows = 0; while ( defined( my ($id,$prod_id,$qty) = $sth->fetchrow_array()) ){ ++$rows; print "====== $id =====<br>"; # for testing } print "NO ITEMS IN CART" unless $rows > 0;
Hope this helps.
In reply to Re: DBI forgets last record
by grinder
in thread DBI forgets last record
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |