Actually, you probably should quote associative indices in strings as well, if you would normally quote them outside of strings.
$result = mysql_query("SELECT * FROM subjects ORDER BY name");
while ($row = mysql_fetch_array($result))
{
echo "<option value='{$row['id']}' ";
if ($row['id'] == $prow['sid']) echo "selected";
echo ">{$row['name']}";
if ($row['id'] == $prow['sid']) echo \" selected\";</option>";
}