so why not skip the nonsense and just use:

PHP Code:
while ($post mysql_fetch_array($posts)) {