See posts 5 and 6 regarding use of db variable.