2
I’m trying to build a dynamic SQL but I’m getting beat up for not understanding how to work with the IN statement in PDO Example:
$SQL = "select * from tabela where (campo in(:valor))";
$Query = Database::Prepare($SQL);
$Query->bindValue(":valor", "1,2");
$Query->Execute();
Field is Integer, I assumed that 1.2 would enter without problems as value, but it says that the search value is invalid, tried in several ways but without success
How to work with this instruction in PDO? As branch breaks I used the OR instruction, but let’s face it is not the best option! The Database is Postgres, but I think that’s not the case, because I could not in Mysql also
Search with Mysql PDO in Array
– rray