title: mysql_query to PDO
body: <p>I have the following code in the old "mysql_query" </p>
  
  <pre><code>$query = mysql_query("SELECT defe FROM information WHERE term = 1");
  $fetch = $db-&gt;fetch_array($query);
  print_r($fetch);
  </code></pre>
  
  <p>I want to transform this to the PDO way of retrieving information from database. I tried the following (did not work- does not display any result) : </p>
  
  <pre><code>$query = $db-&gt;prepare('SELECT defe FROM information WHERE term = 1');
  $fetch = $query-&gt;fetch();
  print_r($fetch);
  </code></pre>
  
  <p>the connection to the database is established and it stored in the <code>$db</code> variable (only the PDO). </p>