title: How can I use PostgreSql's CURRVAL / RETURNING from another php file?
body: <p>I'm running an <code>INSERT</code> query from one php file, but then I need to get the last inserted id from an external php file so as to run another query based on that id. How can I pull this off using <code>CURRVAL</code> or <code>RETURNING</code>? From the external php file, if I do something like </p>
  
  <p><code>$result = pg_query($db,"SELECT CURRVAL('app.example_id_seq'), ... ");</code> I get no results.</p>