It must be evaluated this way:
while(($row = mysql_fetch_array($result)) && $moo == true)
I think that's the problem (==) ($moo is true always because you are assigning a value, not comparing them).
You can have more than one condition, but ... has your $result any row?
$i = 0;
if ($i = 0)
echo "0 is false. This echo is never printed.";
if ($i == 0)
echo "$i equals 0";
Hope this helps,