title: PDO method for mysql_fetch_assoc()?
body: <p>I used to do :</p>
  
  <pre><code>$resource = mysql_query("SELECT * FROM table WHERE id = " . $id);
  $user = mysql_fetch_assoc($resource);
  echo "Hello User, your number is" . $user['number'];
  </code></pre>
  
  <p>I read that mysql statements are all deprecated and should not be used. </p>
  
  <p>How can i do this with PDO?</p>
  
  <p>The first line would be :</p>
  
  <pre><code>$stmt = $db-&gt;prepare("SELECT * FROM table WHERE id = " . $id); // there was an aditional double quote in here.
  $stmt-&gt;execute(array(':id' =&gt; $id));
  </code></pre>
  
  <p>What about the mysql_fetch_assoc() function?</p>
  
  <p>I am using php</p>