First off, you have an issue with your php code. Furthermore, your code is hard to read. And do wrap it in php tags when posting, that is [ php] and [/code]
First, a step up in readability
<?php
// The first time this loop is run, $row_numbers is not set. Will cause an error
do {
// indenting code is awesome
echo $row_numbers['numb'];
?>
Keeping php opening and closing tags on their own rows makes them easier to see.
<br />
<?php
} while ($row_numbers = mysql_fetch_assoc($numbers));
So, let's fix the issues and get rid of one set of <?php ?>
[code=php]
<?php
// doing it like this means $row_numbers is set the first time as well
while ($row_numbers = mysql_fetch_assoc($numbers)) {
// adding the <br/> here means you don't have to drop out of php parse mode
echo $row_numbers['numb'] . '<br/>';
}
?>
And finally, to get the sum you want
<?php
// initialize $sum to 0 before the loop
$sum = 0;
while ($row_numbers = mysql_fetch_assoc($numbers)) {
// adding the <br/> here means you don't have to drop out of php parse mode
echo $row_numbers['numb'] . '<br/>';
// add $row_numbers['numb'] to $sum. cast to int before adding.
$um += (int) $row_numbers['numb'];
}
?>