title: Can I bind a parameter to a PDO statement as a comparison operator?
body: <p>Is this code</p>
  
  <pre><code>class opinion
  {
     private $dbh;
     var $opinionid,$opinion,$note,$actorid,$dateposted;
     var $isnew=FALSE;
     function loadby($column,$value,$operator="="){
         $dbh = new PDO(I deleted parameters here);
         $statement=$dbh-&gt;prepare("select * from fe_opinion where :column :operator :value");
         $statement-&gt;bindParam(":column", $column);
         $statement-&gt;bindParam(":value", $value);
         $statement-&gt;bindParam(":operator", $operator); //UNSURE, DOUBTFUL
         $statement-&gt;bindColumn("opinionid", $this-&gt;opinionid);
         $statement-&gt;bindColumn("opinion", $this-&gt;opinion);
         $statement-&gt;bindColumn("note", $this-&gt;note);
         $statement-&gt;bindColumn("actorid", $this-&gt;actorid);
         $statement-&gt;bindColumn("dateposted", $this-&gt;dateposted);
         $statement-&gt;fetch();
         return $statement-&gt;rowCount(); //please be 1
     }
  }
  </code></pre>
  
  <p>injection safe?</p>
  
  <pre><code>       $statement-&gt;bindParam(":operator", $operator); //UNSURE, DOUBTFUL
  </code></pre>
  
  <p>Can I bind a parameter to a PDO statement as a comparison operator?</p>