fix format

err was always nil inside the if; introduced sqlerr to fix it.
%t formats booleans; changed to %T for representation of the type of
value.