title: PHP pg_connect connection string
body: <p>I'm trying to set up a proper connection string to connect to PG 9.2 from php 5.4. Piece of cake, unless the username contains a space...Maybe somebody can help me get my quoting right.</p>
  
  <p>My attempt:</p>
  
  <pre><code>$dbconn = pg_connect('host=localhost dbname='.$database.' user="demo demo" password='.$password)
  or die('connect failed');
  
  is rejected by the server:pg_connect(): Unable to connect to PostgreSQL server: missing &amp;quot;=&amp;quot; after &amp;quot;demo&amp;quot;&amp;quot; in connection info string in &lt;b&gt;/var/www/myhost.com/PGAccess/query.php
  </code></pre>
  
  <p>thanks, Max</p>