We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

executePrepared returning null

Hi guys,

I want to use the prepare/executePrepared methods for an Insert statement.

The execution of the prepare method return me a PDOStatement object with my query on the value of queryString.

Now, when execute the method $connection->executePrepared($myPDOStatementString, $myArrayBinding), I receive a null value. My connection object contain: Object of: Phalcon\Db\Adapter\Pdo\Oracle

Someone know what happen?

Thank you.

  • Mike


98.9k
Accepted
answer

executePrepared is not intended to be used directly, you can use query, execute, insert, update or delete and these methods will use prepared statements for you

Thanks for the reply.

Now I catch an exception from the insert method. Maybe my problem is that I'm using Oracle spatial function on one of my value of the binding. I know it's a PDO issue but do you know if it's possible? I'm looking for an answer right now. Google is my friend...

Before trying the binding, I was looking for using the escapeString method for some values coming from the user. But it's seem that with PDO Oracle, the escapeString always returning false instead of the escaped value.

I hope to find the good way to do my insertion...