"; $t+=$r['price']*$r['quantity']; $q+=$r['quantity']; $i++; } echo $t." ".$q." ".$i; ?>