in reply to DBI gives out wrong data

Next step to take is to enable tracing on the statement handle ($sth2->trace( 2 ) somewhere before your while loop in this case should do it) and watch exactly what's being returned from mysql under the covers. See perldoc DBI for more info on trace.

--
We're looking for people in ATL