mysql - return query of pdo statements -


i querying database pdo prepared statements , can not figure out how return actual query after executing query.
have tried print_r($statement);, give the pdo prepared query. appreciated!

$sql = ("select * `mysite` `info` :checksite or `users` :checksite"); $stmt = $pdo->prepare($sql); $stmt->bindparam(":checksite", "%$checksite%");  $stmt->execute(); $results = $stmt->fetchall(); foreach($results $row){     echo $row['users']; } 

this quite complicated task , 1 of drawbacks of using prepared statements.

yet api doesn't offer such useful feature out of box. so, way raw sql parse placeholders manually. there home-brewed solutions in answer


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -