use intval rather than dbesc since these are ints. Should work regardless, but this makes it consistent with the way we do most other queries.