title: Display mysqli result multiple times
body: <p>I asked this recently but it got marked as duplicate and deleted.
  Please look at my question before marking it down because it is not the same and I am struggling to figure this out.</p>
  
  <p>I want to echo the 'company' and 'area' results from a MYSQLI query into my page, at separate points in the body of a php page.</p>
  
  <p>Only the first echo will show. Please show my mistake.</p>
  
  <pre><code>&lt;?php 
  
  $path = $_SERVER['DOCUMENT_ROOT'];
  $path .= "/Connections/****";
  include_once($path);
  
  $dbhandle=mysqli_connect($hostname_Demo, $username_Demo, $password_Demo, $database_Demo);
  
  if (mysqli_connect_errno())
  {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $sql_RS1="SELECT * from CompanyName where area = 1";
  $result=mysqli_query($dbhandle,$sql_RS1);
  
  ?&gt;
  
  &lt;head&gt;
  &lt;title&gt;TEST&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
  while($row = mysqli_fetch_assoc($result))
  {
      echo $row['company'];
  }
  ?&gt;
  
  &lt;?php
  while($row = mysqli_fetch_assoc($result))
  {
      echo $row['area'];
  }
  ?&gt;
  
  &lt;?php  $dbhandle-&gt;close();  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>