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 usefetch()
orfetchall()
- a pdosatement
pdo::prepare()
needs populatedbind()
runexecute()
before can usefetch()
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
Post a Comment