title: Doctrine DBAL prepared query
body: <p>I'm usigne PHP doctrine DBAL and what I want to do is a get method like this:</p>
  
  <pre><code>function get($attr, $value){
      $conn = DriverManager::getConnection($params, $config);
  
      $sql = "SELECT * FROM mytable WHERE ? = ?";
      $statement = $conn-&gt;executeQuery($sql, array($attrs, $value));
      return $statement-&gt;fetchAll();        
  }
  get("id", 1);
  </code></pre>
  
  <p>but it doesn't work. I wonder if is possible to obtein parametrization of columns as well as values.
  Here is the docs I'm using: 
  <a href="http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html#executequery" rel="nofollow">http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html#executequery</a></p>