Since you didn't write exactly what you're trying to do, i'm guessing you're trying to return a list of HTML options that a JS callback function will place in your document.
try this:
'.$row['name'].'' . "\n";
}
echo $_GET["jsoncallback"] . "('" . $options . "');";
?>
This will first create all the options as a string, and only then build the callback.