Update $x to $counter in DB class