Created
March 15, 2018 17:01
-
-
Save felixpenrose/b46d7ab26c8af5f0a2f18f63dd79cc15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = [1,2,3]; | |
$in = str_repeat('?,', count($arr) - 1) . '?'; | |
$sql = "SELECT * FROM table WHERE column IN ($in)"; | |
$stm = $db->prepare($sql); | |
$stm->execute($arr); | |
$data = $stm->fetchAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment