最佳答案
以下是我正在努力做的事情的总结:
$array[0] = 1;
$array[1] = 2;
$sql = "SELECT * FROM table WHERE some_id = $array"
显然,有一些语法问题,但这是我想做的,我还没有找到任何东西,说明如何做到这一点。
目前,我的计划是这样做:
foreach($idList as $is)
$where .= 'some_id=' . $id . ' OR';
endforeach
$sql = "SELECT * FROM table WHERE " . $where;
So is there support in PostgreSQL to use an array to search, or do I have to do something similar to my solution?