Answer the question
In order to leave comments, you need to log in
How to correctly make a query with the IN operator in PGSQL?
The essence of the problem. There is a code:
$ids = array(123, 321, 456, 654);
\model\table::exec("UPDATE words SET status = 0 WHERE id IN (?);", implode(',', $ids));
base - postgress, language - php
library - activerecord
when executing such a code, it gives an error, the value for the id field is not correct, the id
field is int8, in the $ids array only int
what am I doing wrong and how to do it right?
thank!
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/pdostatement.execute.php
Example #5. Executing a Prepared Query Using an Array for an IN Statement
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question