I pass to a function an array of categories and I want to make this query:
$sql = "SELECT *
FROM trans
WHERE id_user = $1 AND id_cat IN ($2)";
$value = array($id_user, implode(",", $categories));
$resource = pg_prepare($db, "get_trans", $sql);
$resource = pg_execute($db, "get_trans", $value);
But pg_execute gives me an error
Warning: pg_execute(): Query failed: ERRORE: sintassi di input non valida per il tipo integer: "1,3,5,2,4,6,7" in /var/www/html/progetto-bd/application/function.php on line 370