If ($condition_string) is not working properly
<p>In the following code</p>

<pre><code>$condition_string= "empty($_SESSION['group_by_Name']) &amp;&amp; empty($_SESSION['group_by_Email']) &amp;&amp; empty($_SESSION['group_by_Address']) &amp;&amp; empty($_SESSION['group_by_Age']) &amp;&amp; empty($_SESSION['group_by_Contact'])";
</code></pre>

<p>This code always execute if statement not else. can anybody tell me where is the error in my code.</p>

<pre><code>   $observation_column_name_fetch = mysql_query("SELECT column_name
 FROM  observation_column where observation_id='$observation_id'")
     or die(mysql_error());

     while($observation_column_name_res = mysql_fetch_array( $observation_column_name_fetch ))
     {
      $observation_column_name[]=$observation_column_name_res[column_name];
     }   
     for ($i=0; $i&lt;$observation_column_num; $i++)
     { 
      $group_by=$_POST[group_by_.$observation_column_name[$i]];
      $_SESSION[group_by_.$observation_column_name[$i]]=$group_by;
     }
     $j=1;
     $condition_string="";
     for($i=0; $i&lt;$observation_column_num; $i++)
     {
     $condition_string.= 'empty($_SESSION[\'group_by_'.$observation_column_name[$i].'\'])';
     if($j&lt;$observation_column_num)
      { $condition_string.=" &amp;&amp; ";    $j++;    }
     }
     if($condition_string)
      {
      for ($i=0; $i&lt;$observation_column_num; $i++)
        { echo "if statement executed ".$i." times&lt;br/&gt;";   }
      }
        else
        {
       for ($i=0; $i&lt;$observation_column_num; $i++)
          { echo "else statement executed ".$i." times&lt;br/&gt;";        }
     }
</code></pre>
