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?
There’s this one answer which shows how taking values and substituting placeholders is applicable to PDO as well, has another question about PDO but still not found.
– rray
How to print the SQL statement being sent to the database?
– rray
echo $sql->queryString;
– Dirty Old Man