title: Drupal 6: Programmatically Altering User Values
body: <p>How do you use profile_save_profile?</p>
  
  <pre><code>foreach ($users as $user) { //list of users to act on
      $by_user = views_get_view_result('attendance', 'page_3', array($user-&gt;uid)); //view containing info about this user
      $edit = array('profile_attendance_short_term' =&gt; substr(count($by_user) / count($general), 0, 5)); //calculation
  
      profile_save_profile($edit, $user-&gt;uid, 'Fencing Information', TRUE); //update user profile???
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT:</strong> This also fails:</p>
  
  <pre><code>$edit = array('profile_attendance_short_term' =&gt; 9001);
  
  profile_save_profile($edit, user_load(3), 'Fencing Information', TRUE);
  </code></pre>