$sth1 = $dbh->prepare (qq{ SELECT * FROM `sessions` }); $sth1->execute(); while($row1 = $sth1->fetchrow_hashref()) { next if !$row1->{id}; $sess_ref1 = CWT::Site_DB->open_with_expiration(undef, $row1->{id}); if($sess_ref1->attr("username") eq "$cust_username") { if ($sess_ref1->attr("logged_in") == 1) { $sess_ref1->attr("is_admin",1); } else { next; } } else { next; } } $sth1->finish();