Just a quick and simple snippet, im sure most of you know this one but for those who dont, enjoy.
PHP Code:
<?php
while($row = mysql_fetch_array( $result )) {
$new=$row['fieldname'];
$new_array[] = $new;
}
foreach($new_array as $key => $value) {
echo $key. " - " . $value . "<br />";
}
?>
This will print out something similar to:
0 - result0
1 - result1
2 - result2
3 - result3
4 - result4
etc....
5 - result5