}echo "Total K.W:" echo "</br>";echo $total_kw_pdu_A;echo $total_kw_pdu_B;-------------------------------------------------------------------------------------So the value in $total_kw_pdu_A and $total_kw_pdu_B , is coming from the while loop.

and if i echo the value at last of the loop( as in the example code , it will give me to total , which is expected.

but my problem is : i need to show the output of $total_kw_pdu_A , Beginning of the page ,

Example the page will be like bellow :

Total K.W puda A: $total_kw_pdu_ATotal K.W puda B: $total_kw_pdu_B

Bellow is Individual Break down :-----------------------------------------------------------------------------------------------

now what i am thinking is , by using javascript to update the value ..So if i take an variable like , $new_total_kw_pdu_A , and if i can some how increase the couter as soon as the value of "$total_kw_pdu_A" in increase ...Can this be one ??or is there is any other way ??