How to store multiple values in a profile field (specific to each users)? I have a profile filed called Amount corresponding to each users, and I want to store multiple values in the profile field Amount. Bu using the custom module, the value of Amount is to be inserted on each registration (or it can be inserted any time by a cron program). 

For example User Williams has Value 100 in his Amount field. This is not a single value, it may be

Time    Amount
-------+------
Hour 1 :  10
Hour 2 :  30
Hour 3 :  20
Hour 4 :  35
Hour 5 :   5
============
Total  : 100


I want to display the total amount and individual amount by exact time. 

How to do it?
You might be best installing content profile as this will allow you to use cck, when creating the profile field amount you can set it to unlimited which would allow you to store multiple values in an array for a single field. 

The total would be another dynamic field which is calculated by adding the values from the amount array each time they are changed via a hook

To add the field to a content profile, follow the below steps:


Edit the profile content type 
Go to manage fields
Add a new "text field
Fill in field details
On this page you will see a "number of values" option, choose "unlimited"


You can update content profile fields as below, just put it in a custom module or something:

//load current user
global $user;
//find the users content profile
$uid = $user-&gt;uid;
$node = content_profile_load(profile,$uid);
$pid = $node-&gt;nid;
$node = node_load($pid);
//update the field AMOUNT
$node-&gt;field_AMOUNT[0]['value'] = $var1;
$node-&gt;field_AMOUNT[1]['value'] = $var2;
//do the same for the TOTAL with calculations
$node-&gt;field_TOTAL[0]['value'] = $var1 + $var2;
//save the content profile node
node_save($node);