I have a PHP script that updates the 'userpoints_count' record.
I want to change it so it also updates the 'userpoints_totalearned' record as well. The 'userpoints_totalearned' record is in the same database, table and row as 'userpoints_count' but may or may not contain the same amount of points. I need the function to do the same thing (increase points) to both records.
Here is original code:
if($aArcadeSttng['activitypoints'] > 0){
//grab user points
$sql = "SELECT `[COLOR="SeaGreen"]userpoints_count[/COLOR]` FROM `se_semods_userpoints` WHERE `userpoints_user_id` = '$iUserId'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
$userpoints = $row['[COLOR="seagreen"]userpoints_count[/COLOR]'];
//add points
$finalpoints = $userpoints + $aArcadeSttng['activitypoints'];
$sql = "UPDATE `se_semods_userpoints` SET `[COLOR="seagreen"]userpoints_count[/COLOR]` = '$finalpoints' WHERE `userpoints_user_id` = '$iUserId'";
$result = mysql_query($sql) or die(mysql_error());
}
I've tried several different things but I can't get it to work. I'm sure this is very elementary for an experienced coder. Any help will be greatly appreciated