Array in the parameter when creating PDO query
问题 Can I use a few lines in the parameter Example SELECT id, city_id FROM an_objects WHERE city_id IN (:arrCity) (:arrCity) (1,2,3,4,5,6) But now I have done like this SELECT id, city_id FROM an_objects WHERE city_id IN (:1p, :2p, :3p, ...... :100p) And it's very bad 回答1: <?php private function PDOBindArray(&$poStatement, &$paArray){ foreach ($paArray as $k=>$v) { @$poStatement->bindValue($k, $v[0], $v[1]); } } // the array structure should now look something like this $inputArray = array( '