We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
$sth->fetchrow_array() returns a row (assuming one exists), and has the side effect of moving "past" that row in the set of database results. With this line:
print "NO ITEMS IN CART" unless $sth->fetchrow_array();
you try to retrieve a row. There might not be one, in which case you print "no items". But if there is, you don't assign the return value to a variable, so it just gets thrown away -- yet the results pointer still moves forward. That row won't show up in the list you generate in your while loop. A possible fix could work something like this (untested):
$perlmonks{seattlejohn} = 'John Clyman'; In reply to Re: DBI forgets last record
by seattlejohn
|
|