Thank you kows 
My current while loop uses mysql_fetch_object as it needs to display the product picture:
PHP Code:
//retrieve cart items and details
$sqlcart = ("SELECT * FROM orders, orderitem, product
WHERE .....";
$resultcart=@mysql_query($sqlcart);
//show cart items
while ($row = mysql_fetch_object($resultcart)) {
$quantity = $row->OrderItemQuantity;
.......
}
Now because of this I couldn't use your array one instead, so I used it inside the loop with some debugging code to see if it was calculating it correctly which it was so that was cool! The total was fine but it stuffed up the object loop and stopped it from display all records.
So I tried using the array code AFTER the object loop but for some reason it didn't go through the cart items and show the debugging code in the loop - shipping stayed at 0.
Its using the same $resultcart so I thought it would be doing the query ok.
PHP Code:
//sql query as above
//then object while loop
//set shipping value as zero
$shipping = 0;
while($array = mysql_fetch_array($resultcart)){
//do not display as already have
//just using loop for shipping value purposes
//add onto the shipping value
$shipping += $array['ProductShippingValue'];
//debugging
echo "shipping value = " . $shipping;
} //end while here
//show subtotal
//show shipping
//show total
I'm pretty sure I'm doing something stupid, please let me know if you are after different code examples.