title: Using PHP PDO is it possible to bind a parameter to be used by a MySQL function?
body: <p>Inside MySQL I have a function named <em>GetLongitude</em> and I'm trying do to this without success. </p>
  
  <p>First try:</p>
  
  <pre><code>$sql = "select GetLongitude(:cidade) as lon;";
  $stmt = $dbHandle-&gt;prepare($sql);
  $stmt-&gt;bindParam(':cidade', $cidade, PDO::PARAM_STR);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>Second try:</p>
  
  <pre><code>$sql = "select GetLongitude(?) as lon;";
  $dbHandle-&gt;setAttribute( PDO::ATTR_EMULATE_PREPARES, false );
  $stmt = $dbHandle-&gt;prepare($sql);
  $stmt-&gt;execute(array($cidade));
  </code></pre>
  
  <p>(The sql above is just a simple example.)</p>
  
  <p>Any ideas?</p>