The problem is that you don't know how to implement functions.
You do not declare a function inside a while loop. Plus, why do you need array_sum()???
Seems to me that you code, could be rewritten as
$sum=0;
while ($trow=mysql_fetch_array($tssel))
$sum+=$trow["AcctSessionTime"];
You don't need array_sum to be used within while loop because you are fetching only one value at a time... So if you pass one value as an array -> that's incorrect, because if array contains only one value, then the sum would be that one value.
Di