options are not getting printed/echoed?
<p>This page generates the option pulled from database . another page brings here the year of joining of students via year_joining . rest of the mysql queries works absolutely fine ( tested )</p>

<pre><code>&lt;?php
include_once("../Include/connectdb.php");

if($_GET['year_join'])
{
$id=$_GET['year_join'];

$result1 = mysql_query("select distinct sub_id from subject_profile where   batch='$id'        

")or die(mysql_error());

  while($subid = mysql_fetch_assoc($result1)){

 $result2 = mysql_query("SELECT name FROM  `subjects` WHERE  `sub_id` LIKE    

'$subid[sub_id]'");

    $subject=mysql_fetch_assoc($result2);

    if($subject[name]!=""){
  //print "&lt;OPTION value=".$tmp.'"&gt;'.$tmp.'&lt;/OPTION&gt;';
  //print "&lt;OPTION value='$tmp'&gt;'$tmp'&lt;/OPTION&gt;";
  echo "&lt;option value=".$subject['name'] . '"&gt;' . $subject['name'] . '&lt;/option&gt;';
  //echo '&lt;option value="'.$id.'"&gt;'.$data.'&lt;/option&gt;';
 //}
 }
}
}
?&gt;
</code></pre>

<p>FYI : </p>

<pre><code>//print "&lt;OPTION value=".$tmp.'"&gt;'.$tmp.'&lt;/OPTION&gt;';
//print "&lt;OPTION value='$tmp'&gt;'$tmp'&lt;/OPTION&gt;";
echo "&lt;option value=".$subject['name'] . '"&gt;' . $subject['name'] . '&lt;/option&gt;';
//echo '&lt;option value="'.$id.'"&gt;'.$data.'&lt;/option&gt;';
</code></pre>

<p>none of these are working ... :(</p>

<p>with simple echo $tmp it works 
but when ever i put as </p>

<pre><code>echo "&lt;option value=";
</code></pre>

<p>the result is blank page ...</p>

<p>and when i am echo - ing just the variable its works perfectly fine </p>

<pre><code>echo $tmp;
</code></pre>

<p>gives the list of all the subjects ..</p>
