isset() code is causing a parse error
<p>Below is the code:</p>

<pre><code>if (isset($_POST['module']))
{
    $query = "SELECT ModuleNo, ModuleName FROM Module WHERE ModuleId = ?";

    $stmt = $mysqli-&gt;prepare($query);

    $stmt-&gt;bind_param('s', $_POST['module'] );

    $stmt-&gt;execute();

    $stmt-&gt;bind_result($moduleno, $modulename); 

     while ( $stmt-&gt;fetch() ) { 
           // session data
          if (isset($moduleno)){
          $_SESSION['idmodule'] = $moduleno;
      }
      if (isset($modulename)){
          $_SESSION['namemodule'] =  $modulename;
            }
    }

    $_SESSION['module'] = $_POST['module'];

}
</code></pre>

<p>.</p>

<pre><code>    $outputDetails = "";
    $outputDetails .= "
    &lt;table id='sessionDetails' border='1'&gt;
    &lt;tr&gt;
    &lt;th class='tblheading' colspan='2'&gt;ASSESSMENT DETAILS&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr class='trheight'&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;th&gt;Course:&lt;/th&gt; 
    if (isset($_SESSION['idmodule'], $_SESSION['namemodule']) { //line 909
&lt;th&gt;{$_SESSION['idmodule']} {$_SESSION['namemodule']}&lt;/th&gt;
}
    &lt;/tr&gt;
    &lt;/table&gt;";

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

<p>I am getting a parse error on line 909 if I try to include isset() for 2 session variables:</p>

<pre><code>Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING 
</code></pre>

<p>What am I doing wrong with my isset() code and what do I need to change in order to be able to fix the error?</p>

<p>UPDATE:</p>

<p>This is my attempt to fix this but I am getting an error stating <code>Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in ... on line 1671</code>:</p>

<pre><code>$outputDetails = "";
$outputDetails .= "
&lt;table id='sessionDetails' border='1'&gt;
&lt;tr&gt;
&lt;th class='tblheading' colspan='2'&gt;ASSESSMENT DETAILS&lt;/th&gt;
&lt;/tr&gt;
&lt;tr class='trheight'&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Module:&lt;/th&gt; 
";

if (isset($_SESSION['idmodule'] &amp;&amp; $_SESSION['namemodule'])) {  //error pointing here

$outputDetails .= "
&lt;th&gt;{$_SESSION['idmodule']}  {$_SESSION['namemodule']}&lt;/th&gt;
&lt;/tr&gt;";
$outputDetails .= "&lt;/table&gt;";

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