PHP PDO:使用WHERE子句中的存储函数执行查询

I'm trying to execute a query and one of the conditionals in the SELECT is a MySQL function.

The stored function receive two parameters and return 1/0 values, depending on the result.

When I use the app Navicat executing the query, it works fine but when executed in PHP not.

This is the query:

SELECT g.* 
FROM PR6015.georefencia as g 
WHERE g.code='C' 
  AND isPointInRegion('".$lat."', '".$lon."', g.G, g.K)

This query is invoked using PDO.

Is there something missing?

Thanks in advance.