3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $related = array(1,2,3); $sql = "SELECT id,title,pic1 FROM tbl_products WHERE id IN ("; $sql .= trim(str_repeat("?,",count($related)),","); $sql .= ") LIMIT 3;"; echo $sql;
based on No4h1
Output for 5.5.0 - 7.2.0
SELECT id,title,pic1 FROM tbl_products WHERE id IN (?,?,?) LIMIT 3;