I have this query at the moment that subtracts 1 from the total of a field called total votes.
What I really need it to do is stop subtracting one when totalvotes gets to 0 so that this value never goes into the negative.
$query = "UPDATE brands SET totalvotes=totalvotes-1 WHERE company = '" . $row['company'] . "'";