title: SELECT CURRVAL (pg_get_serial_sequence Im doing something wrong?
body: <p>What am I doing wrong, I am trying to get the last record_id from a table, after the first statement inserts it into my table. I seem to just print the code that is meant to display the last id?</p>
  
  <pre><code>      SELECT CURRVAL (pg_get_serial_sequence('sheet_tbl','sheet_id'))";
  </code></pre>
  
  <p><strong>Code here</strong></p>
  
  <pre><code>  else {
          echo 'Record added';
          $sql = "INSERT INTO sheet_tbl (site_id,  eventdate, eventtime, username, additionalvolunteers) VALUES ('$_POST[site_id]','$_POST[eventdate]','$_POST[eventtime]', '$username','$_POST[additionalvolunteers]')";
  
          echo $sql; //Just so I can see what is getting sent
          $result = pg_query($sql);
  
          $sheet_id_pull = "SELECT CURRVAL (pg_get_serial_sequence('sheet_tbl','sheet_id'))";
          echo $sheet_id_pull; //This is where im having the issue with the above line.
  }
  </code></pre>