public function resetArgumentVotes(Argument $argument) { global $sDB, $sQuery; $inc = 0; $res = $sDB->exec("SELECT * FROM `user_votes` WHERE `argumentId` = '" . i($argument->argumentId()) . "';"); while ($row = mysql_fetch_object($res)) { $inc += $row->vote; } $sDB->execUsers("UPDATE `users` SET `scoreArguments` = `scoreArguments` - " . i($inc) . " WHERE `userId` = '" . i($argument->userId()) . "' LIMIT 1;"); $sDB->exec("DELETE FROM `user_votes` WHERE `argumentId` = '" . i($argument->argumentId()) . "';"); }