update a column by subtracting a value

UPDATE a75ting.username
SET points = points - 5

by putting the single quotes around the “points -5”, you converted that expression into a plaintext string. Leaving it without the quotes lets MySQL see you’re referring to a field (points) and subtracting 5 from its current value.

Leave a Comment