Apologies for the newbishness of this question. I'm just starting a project and I have an array of IDs to grab certain records from a table. What's the best way to go about this?
Will the following work?
public function getWork($slideIDs) {
$params = array();
$params = $slideIDs;
$count = count($params);
for($i=0;$i<$count;$i++) {
$STH = $this->_db->prepare("SELECT *
FROM slides
WHERE slideID = :slideID;");
$STH->execute($params[$i]);
}
$result = $STH->fetchAll(PDO::FETCH_ASSOC);
return $result;
}
Thanks.