我将一个类别数组传递给一个函数,我想做这个查询:
$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);
但是 pg_execute 给了我一个错误
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