title: How to echo results of database query?
body: <p>I have written some code to access my database and echo the results onto the webpage. Unfortuantely, I must have something wrong in my code. Thank you so much for any assistance.</p>
  
  <pre><code>$conn = new mysqli("website.com","Ericjs","Password","i4706992_wp1");
  if ($conn) {
  echo "Connection established! &lt;br&gt;";
  } else {
  die("Connection failed. Reason: ".mysqli_connect_error());
  }
  echo "Eric, I'm here first &lt;br&gt;";
  $sql="SELECT Facility Name, Address, City, State, Zip FROM 'wp_facilities' 
  WHERE 'Zip' = '01040' LIMIT 50";
  echo "Eric, I'm here second &lt;br&gt;";
  $results=mysqli_query($conn,$sql);
  echo "Eric, I'm here third &lt;br&gt;";
  if (mysqli_num_rows($results)&gt;0) {
  while($row=mysqli_fetch_array($results))  {
  echo "Let's get ready to roll! &lt;br&gt;"; 
  echo $row[1]." ".$row[2]." ".$row[3]." ".$row[4]." ".$row[5];
  echo "&lt;br&gt;";
  }
  }
  mysqli_close($conn);
  </code></pre>
  
  <p>The output I get are the echoes prior to the if statement above.</p>
  
  <blockquote>
    <p>Connection established!<br>
    Eric, I'm here first<br>
    Eric, I'm here second<br>
    Eric, I'm here third</p>
  </blockquote>
  
  <p>I was looking for the results to be displayed as:</p>
  
  <blockquote>
    <p>"Ryan Rink" "524 Pleasant St" "Watertown" "Massachusetts" "01040"</p>
  </blockquote>