title: PHP displays first character of string when single result, but full string when multiple results
body: <p>So the problem that I am encountering is that I have a select field that is populated via PHP. A MySQL DB is queried and the PHP processes the returned array, printing it into the select field's options. </p>
  
  <p>However, when a single result is returned from the DB, only the first character of the string is displayed. If multiple results are returned, then all results display fully. I have checked that when a single result is returned, that the string itself is correct, which it is, so I don't believe this to be an issue with the data retrieval. Furthermore, no errors are generated either, so no clues are provided as to where things are going wrong. </p>
  
  <p>I've tried to find other StackOverflow posts describing this issue, but haven't found anything, nor can I find anything elsewhere on the internet.</p>
  
  <p>This is the DB Stored Procedure that collects the results:</p>
  
  <pre><code>BEGIN
  SELECT BranchID, City FROM Branch;
  END
  </code></pre>
  
  <p>Then this PHP turns that data into an associative array:</p>
  
  <pre><code>$result = $currentconnection-&gt;DBQuery("CALL Fetch_Branch_City_All()");
          if( !$result) die($mysql-&gt;error);
          while($row = $result-&gt;fetch_assoc()){
              $BranchID = $row["BranchID"];
              $CityName = $row["City"];
              $results = $this-&gt;array_push_assoc($results, 'BranchID', $BranchID);
              $results = $this-&gt;array_push_assoc($results, 'CityName', $CityName);
          }
  </code></pre>
  
  <p>This is a go-between piece of code that calls the function above and makes it available to the code below, via the $Query variable.</p>
  
  <pre><code>$Query = $pModel-&gt;fetchBranchCity();
  </code></pre>
  
  <p>And finally this code creates the select from the array data:</p>
  
  <pre><code>&lt;?php //Note if only one branch in system, displays single character
                  extract($Query, EXTR_OVERWRITE);
  
                  for ($a = 0; $a &lt; count($BranchID); ++$a) {
                      if($BranchID[$a] == $BranchIDText){ ?&gt;
                          &lt;option value="&lt;?=$BranchID[$a]?&gt;" selected="selected"&gt; &lt;?=$CityName[$a]?&gt; &lt;/option&gt;
                      &lt;?php }else{ ?&gt;
                          &lt;option value="&lt;?=$BranchID[$a]?&gt;"&gt; &lt;?=$CityName[$a]?&gt; &lt;/option&gt; 
                      &lt;?php }
                  }
                  ?&gt;
  </code></pre>