How to pass PHP array to Postgres query as a parameter

I try to pass a PHP array to Postgres as below but I'm getting an error;

$arrayIDs = array('24','7','8','9','13');

$data = SelectItemsForUpdate($arrayIDs);

function SelectItemsForUpdate($arrayIDs) 
{ 
  $query = PrepareQuery('select id, quantity from items where id in ($1) for update ');      
  $result = ExecutePreparedQuery($query, Array($arrayIDs));          
  ...
  ...
} 
   


Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation