Some Help with update another table

I need some help again pls

// SQL statement parameters
$sum_points = “SELECT
sum(result_answer_points)
FROM results_answers
WHERE resultid = ‘{resultid}’”;
sc_exec_sql($sum_points);

$update_table = ‘results’;
$update_where = “resultid = ‘{resultid}’”;
$update_fields = array(
"result_points = ", (Here I need to update de $sum_points but I don’t know how to do it)
);

// Update record
$update_sql = ‘UPDATE ’ . $update_table
. ’ SET ’ . implode(’, ', $update_fields)
. ’ WHERE ’ . $update_where;
sc_exec_sql($update_sql);

To make it simple: $updatesql=“update results set result_points=$mypoints where resultid=’{resultid}’”;

Thank you Albert