title: Mysqli Get Entire Row
body: <pre><code>#Do a database query and return all rows of GET ID  
  $result=$mysqli-&gt;query("SELECT * FROM products WHERE product-id = '$id'");
  
      while($row=$result-&gt;fetch_array())
      {
          $id             =     $row['product-id'];
          $pagename       =     $row['product-name'];
          $description    =     $row['product-description'];
          $samples        =     $row['product-sample-designs'];
      }
  
  
  # free result set
  mysqli_free_result($result);
  }
  
  #close connection
  mysqli_close($mysqli);
  </code></pre>
  
  <p>If i remove <code>WHERE product-id = '$id'</code> # Result is no errors and first row is displayed.</p>
  
  <p>As the code shows I get this error: "Fatal error: Call to a member function fetch_array() on a non-object"</p>
  
  <p>I'm just trying to get all the data in a row where my GET id = the TABLE <code>product-id</code>. This process is much easier in MYSQL. Im new to this OOP style and I find it confusing. An explanation is greatly appreciated. ~THANKS!</p>