title: Comparison of two variables, CodeIgniter
body: <p>I'm currently developing a system in which the main function of it is to assess a user inputted variable, and a pre-stored variable and determine if they are the same or not, if they are, the user passes and if not, the user fails. </p>
  
  <p>Currently the code I have is only outputting "Failed", even though the test data I have put in the system should show the results as having passed. The code I have is below. Only the bottom three divs actually link to the problem at hand, but I have included the entire section for reference.</p>
  
  <pre><code>&lt;?php foreach($results as $row): ?&gt;
      &lt;div id="account-id"&gt;
          &lt;?php echo $row-&gt;accountid;
              $account = $row-&gt;accountid; ?&gt;
      &lt;/div&gt;
      &lt;div id="assignment-title"&gt;
          &lt;?php echo $row-&gt;assignmentname;
              $name = $row-&gt;assignmentname; ?&gt;
      &lt;/div&gt;
      &lt;div id="assignment"&gt;
          &lt;?php echo $row-&gt;assignment;
              $code = $row-&gt;assignment; ?&gt;
      &lt;/div&gt;
      &lt;div id="assignment"&gt;
          &lt;?php
              $variable = $row-&gt;assignment;
              $output = eval($variable); ?&gt;
      &lt;/div&gt;
      &lt;div id="assignment"&gt;
          &lt;?php echo $row-&gt;expectedoutcome;
          $test = $row-&gt;expectedoutcome; ?&gt;
      &lt;/div&gt;
      &lt;div id="assignment"&gt;
          &lt;?php
              if(strcmp($output, $test) == 0) {
                  echo "Passed"; 
                  } else {
                  echo "Failed"; } ?&gt;
      &lt;/div&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4CaGe.png" rel="nofollow noreferrer">This image shows the schema for the relating database table</a></p>
  
  <p><a href="https://i.stack.imgur.com/uzeaV.png" rel="nofollow noreferrer">This is an image of the data within the table itself</a></p>