I think here's the mistake:
$result will go without quotes in mysql_fetch_array()

while($row = mysql_fetch_array($result,MYSQL_BOTH))

http://in2.php.net/manual/en/functio...etch-array.php