title: Convert PG_query to PDO statement
body: <p>I'm a bit lost with this statement. I am trying to convert this PG_query script into PDO. The Idea is that I can then use this example, to pull other values from the database and display in a form.I can populate a dropdown with the PDO but wasn't sure what to do so I can grab row values and fill form items. So this example I just want to grab rivername.</p>
  
  <pre><code>$result = pg_query("SELECT * FROM rivers_tbl WHERE river_id  = '$river_id'");
  $test = pg_fetch_array($result);
    if (!$result) 
      {
      die("Error: Data not found..");
      }
      $rivername = $test['rivername'];
  </code></pre>
  
  <p><strong>I have a DB connection working and this part of my query in PDO</strong></p>
  
  <pre><code> $stmt2 = $conn-&gt;prepare("SELECT * FROM rivers_tbl WHERE river_id  = '$river_id'");
     if ($stmt2-&gt;execute()) {
         $stmt2-&gt;setFetchMode(PDO::FETCH_ASSOC);
         }
  </code></pre>