How to see the final query that was executed? PHP PDO

Asked

Viewed 378 times

3

I make my appointments as follows:

$sql = "Select * From minha_tabela Where meu_campo = :parametro";
$sql = $db->prepare($sql);
$sql->bindParam(":parametro", $parametro, PDO::PARAM_STR);
$sql->execute();

However

echo $sql->rowCount(); //RETORNA ZERO

I’d like to show off my query after passing through the bindParam to check exactly what was executed. How can I recover it?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.