title: Postgres fetch query returning boolean error
body: <p>Can someone please help explain why I am getting errors with Postgres query?</p>
  
  <p>I have tried both variances of pg_fetch &amp; pg_object in my query, but I continue to get a warning error:</p>
  
  <p><strong>Warning: pg_fetch_assoc() expects parameter 1 to be resource, boolean given in /opt/vhosts/body.php on line 45</strong></p>
  
  <p>Can someone help confirm that my query is correct, or if my assumption that I am getting a boolean return because I am not getting a response from the server for my specific table - therefore issue with server or db access...</p>
  
  <p>I've checked DB connection, it is good and connected.</p>
  
  <p>Here is my query: </p>
  
  <pre><code>&lt;?php
  ini_set('display_startup_errors',1);
  ini_set('display_errors',1);
  error_reporting(-1);
  
      require_once ('.db.conf.php');
      $db = pg_connect($dbstr_RW);
      //$login = $_SERVER['PHP_AUTH_USER'];
  
   $result = pg_query($db, "select * from user");
  
  ?&gt;
  </code></pre>
  
  <p>Here is my result array - logic is select all from user table and output city data within that table.</p>
  
  <pre><code>&lt;?php
  
  while($row = pg_fetch_assoc($result))
  {
      echo $row['city']."&lt;br&gt;";
  }
  
  echo "&lt;/ul&gt;&lt;/div&gt;";
  
  ?&gt;
  </code></pre>