我可以将值传递给此查询吗?如果是这样,$ arr的格式是什么?
$sql = "SELECT * FROM tree WHERE tree_id IN $1";
$result2 = pg_query_params($sql2,[$arr]);
答案 0 :(得分:0)
$sql = "SELECT * FROM tree WHERE tree_id = ANY ($1)";
$result2 = pg_query_params($sql2,[$arr]);
$ arr format example =“{12,13}”