I am trying to not show some elements in a form depending on the number of rows froud from the query. But problem is that it is outputting some of the if statement and not hiding the form.
Below is an if statement to display a message if no rows are found:
if($sessionnum ==0){
$pHTML = "<span style='color: red'>Sorry, You There No Assessments under this Module</span>";
}
The above is fine but below is the problem where I am trying to only show something in the form if the a row is found from the query:
$assessmentform = "<div id='lt-container'>
<form action='".htmlentities($_SERVER['PHP_SELF'])."' method='post' id='assessmentForm'>
<p id='warnings'>{$pHTML}</p>
{$outputmodule}
if($sessionnum !=0){
<p><strong>Assessments:</strong> {$sessionHTML} </p>
}
</form>
</div>";
echo $assessmentform;
You can not write condition in side a string.