title: PHP Form select correctly populates MySQL values, does not with simple PHP echo
body: <p>I have a PHP select that dynamically populates based on a MySQL recordset and uses a in_array value to identify and select the value(s) found in the database like this:</p>
  
  <pre><code>&lt;select name="StaffSetSelection[]" size="5" multiple="MULTIPLE" id="StaffSetSelection"&gt;
      &lt;option &lt;?php if ($totalRows_StaffSetID == 0) { echo "selected"; } ?&gt; value=""&gt;Choose a Staff Set&lt;/option&gt;
      &lt;?php
      do {
          ?&gt;
          &lt;option &lt;?php if (in_array($row_StaffSetChoices['EmpNumber'], $StaffSetIDs)) {
              echo "selected";
          } ?&gt; value="&lt;?php echo $row_StaffSetChoices['EmpNumber'] ?&gt;"&gt;&lt;?php echo $row_StaffSetChoices['EmpFirstName'] ?&gt;&lt;/option&gt;&lt;?php
      } while ($row_StaffSetChoices = mysql_fetch_assoc($StaffSetChoices));
      $rows = mysql_num_rows($StaffSetChoices);
      if ($rows &gt; 0) {
          mysql_data_seek($StaffSetChoices, 0);
          $row_StaffSetChoices = mysql_fetch_assoc($StaffSetChoices);
      }
      ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Instead of displaying the selected values in a form option select I'd like to just display them as text.</p>
  
  <p>I've tried to use the in_array again in a simple php echo but it does not display the data and there are no errors in my apache log.</p>
  
  <p>This is what I've tried:</p>
  
  <pre><code>&lt;?php if(in_array($row_StaffSetChoices['EmpNumber'], $StaffSetIDs)) echo $row_StaffSetChoices['EmpFirstName']?&gt;
  </code></pre>