while($newdata = $sth->fetchrow_hashref){ if (($newdata->{NEID} eq ($neid))&& ($newdata->{TS} eq ($NB_TS))) {