3
I have a query similar to this:
$modelos = "1,2,3,4";
$sql = "Select codigo_modelo, nome From modelos Where codigo_modelo in (:codigo_modelo)"
$sql->bindParam(":codigo_modelo",$modelos,PDO::PARAM_INT); //TAMBEM JA TENTEI COM PARAM_STR
But keeps returning me 0 Rows.
Doing otherwise everything happens normally:
$modelos = "1,2,3,4";
$sql = "Select codigo_modelo, nome From modelos Where codigo_modelo in (".$modelos.")"
Any idea? I would like to continue using the bindParam
for obvious reasons...
For each value a placeholder is required, you can implement this mechanism thus
– rray