title: How can I properly use a PDO object for a parameterized SELECT query
body: <p>I've tried following the PHP.net instructions for doing <code>SELECT</code> queries but I am not sure the best way to go about doing this.</p>
  
  <p>I would like to use a parameterized <code>SELECT</code> query, if possible, to return the <code>ID</code> in a table where the <code>name</code> field matches the parameter. This should return one <code>ID</code> because it will be unique.</p>
  
  <p>I would then like to use that <code>ID</code> for an <code>INSERT</code> into another table, so I will need to determine if it was successful or not.</p>
  
  <p>I also read that you can prepare the queries for reuse but I wasn't sure how this helps.</p>