Hi i'm sure there is any easy answer to this but hopefully someone can point me in the right direction.
I have an array with id numbers, sometimes there are duplicates in the array which is what i want. With these id numbers i'm doing a mysql query and pulling out an image link, the problem is that the results i get back from mysql aren't displaying the duplicates, so say i had 3 id 1's in the array i will only get back 1 image instead of the 3 if you get what i mean.
the code i have so far is this:
Can anyone tell me how i can get the duplicates as well?PHP Code:$addId = implode(",",$sessProduct);
$getSessionItems = mysql_query("SELECT * FROM products WHERE id IN ($addId)", $connection);
if(!$getSessionItems){
die("Database Query Failed: " . mysql_error());
}
while ($row = mysql_fetch_array($getSessionItems)){
echo $row["image"] . ", " . "</br>";
}
Thanks



Reply With Quote

Bookmarks