Use an internal count for %d interpolation.

Relying on the db containing a numeric primary key is problematic. You may not
have numeric ids, you may not be using an id at all, etc etc etc.