in reply to DBI forgets last record

I removed
print "NO ITEMS IN CART" unless $sth->fetchrow_array();
and the script now works fine... Why?