Is this the updateUserField method?
/**
* updateUserField - Updates a field, specified by the field
* parameter, in the user's row of the database.
*/
function updateUserField($username, $field, $value){
$q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'";
return mysql_query($q, $this->connection);
}
if it is, unless 'points' in...
$database->updateUserField($subuser, "points", points + (int)$_POST['addpointsl']);
is a constant you have defined, you are effectively just making the value: $_POST['addpointsl'] (which I believe is what you said it was doing.)
USE bradgrafelman's example as the updateUserField method doesn't let you add the summation to the query. You can send that query to the $database->query() method, if it's the class I think it is:
/**
* query - Performs the given query on the database and
* returns the result, which may be false, true or a
* resource identifier.
*/
function query($query){
return mysql_query($query, $this->connection);
}