use a foreach function
like
foreach ($result as $var)
{
print "$var<br>";
}
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..