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

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept