Hi I'm aware of the method you are stating but unfortunately my problems not that simple.
I have fields like so:
id,room,username, int1,int2,int3,int4,int5
36,dining,mitch,1,2,1,2,1
42,bed,mitch,1,2,2,2,1
I then work out that dining is worth 7 and bed is 8. I then want these details in an array.
Any ideas please?!
I need an array of these values:
$audit = "SELECT * FROM audit WHERE username LIKE 'mitch'";
$auditResults = mysql_query($audit);
while ($auditRow = mysql_fetch_array ($auditResults)){
$int1 = $auditRow["int1"];
$int2 = $auditRow["int2"];
$int3 = $auditRow["int3"];
$int4 = $auditRow["int4"];
$int5 = $auditRow["int5"];
$totals = $int1+$int2+$int3+$int4+$int5;
$totalarray = array($totals);
}
Unfortunately this doesn't work and build up an array of what I want. It only saves the last total not all the totals.