Update db.class.php

Updated addToTable function so it now supports objects as input.