php - Determine if PDOStatement object originated from PDO::query() or PDO::prepare() -


both pdo::query() , pdo::prepare() return pdostatement object 2 used differently:

  • a pdostatement pdo::query() ready immediate use fetch() or fetchall()
  • a pdosatement pdo::prepare() needs populated bind() run execute() before can use fetch()

is there way can differentiate between pdosatement came pdo::query() versus 1 came pdo::prepare()?

i'm not entirely sure can tell them apart. both pdo::prepare() pdo::query() return pdostatement object doesn't appear have methods determining origin.

that being said, debugdumpparams() function include parameter count in output, you'd need manually capture , parse output text obtain it.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -