使用相同的通配符一次选择多行foreach

I have a database like this:

banner     |  image  |  date
------------------------------
123_first  |  xxxxx  |  date
123_second |  xxxxx  |  date
134_foo    |  xxxxx  |  date
134_foo    |  xxxxx  |  date
134_bar    |  xxxxx  |  date

I need to get:

banner     |  image  |  date
-----------------------------
134_foo    |  xxxxx  |  date
134_bar    |  xxxxx  |  date

When I select a specific ID (the 134). So I need to get all the banners id only on the first occurrence of each one.

I'm using this PDO statment but it doesn't return anything:

$sth = $dbh->prepare('SELECT `banner` FROM `abanners` WHERE `banner` LIKE ? ORDER BY `date` DESC GROUP BY `banner`');
$sth->execute(array($user["id"] . "%"));

The result should be:

Array('134_foo', '134_bar');

How can I fix the problem?

Try

$id = $user["id"];
$sth = $dbh->prepare('SELECT `banner` FROM `abanners` 
                     WHERE `banner` LIKE ? ORDER BY `date` DESC GROUP BY `banner`');
$sth->execute(array("$id%"));

If you have a unique ID, you could get an array of 'banner` like this:

$sth = $dbh->prepare('SELECT `ID-hope_you_have_one`, `banner` FROM `abanners` WHERE `banner` LIKE ? ORDER BY `date` DESC GROUP BY `banner`');

$sth->execute(array($user["id"] . "%"));

$array_indexed_by_id = $sth->fetchAll(PDO::FETCH_KEY_PAIR);