title: mysqli_query, mysqli_fetch_array and while loop
body: <p>I am new to PHP and I am trying to build a website using PHP. I have localhost for testing the result and I have phpmyadmin already installed on the website.</p>
  
  <p>What i am trying to do now, is to list the contents of my table "property" from database "portal" and fill a table with the results.</p>
  
  <p>I am using <code>mysqli_query</code>, <code>mysqli_fetch_array</code> and while loop. I'm getting the following error:</p>
  
  <blockquote>
    <p>Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result,
    boolean given in C:\xampp\htdocs\falcon\portal\forms\edit listing.php
    on line 15</p>
  </blockquote>
  
  <pre><code>session_start();
  require_once "connect_to_mysql.php"; // where i store username and password to access    my db.
  
  $sqlCommand = "SELECT * property FROM portal"; // dbname: portal - table: propery
  $query = mysqli_query($myConnection, $sqlCommand);
  
  $Displayproperty = '';
  while ($row = mysqli_fetch_array($query))
  $id = $row["pid"];
  $title = $row["ptitle"];
  $area = $row["parea"];
  $city = $row["pcity"];
  $Displayproperty .= '&lt;table width="500" border="0" cellspacing="0" cellpadding="1"&gt;
  &lt;tr&gt;
  &lt;td&gt;' . $id . '&lt;/td&gt;
  &lt;td&gt;' . $title . '&lt;/td&gt;
  &lt;td&gt;' . $area . '&lt;/td&gt;
  &lt;td&gt;' . $city . '&lt;/td&gt;
  &lt;td&gt;&lt;a href="forms.php?pid=' . $id . '"&gt;Upload images&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;';
  </code></pre>