I have an array:
PHP Code:
 productid = [1,2
. Now I want to fetch data from product table by using this part of code:

Code:
$sql = 'SELECT name FROM product WHERE id=:id';
$s = $pdo->prepare($sql);
foreach($productid as $id)
{
  $s->bindValue(':id', $id);
  $s->execute();
}
when I returned the names as follow:

Code:
foreach($s as $row)
{
  $name[] = array(
      'name' => $row['name']
  );
}
I just got the product name of second id and didn't get both names. What's the problem?