View Single Post
Old 18-03-2008, 13:23   #3 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 828
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Well if you are using PHP then you can use the built in function "array_unique". Basically, take your array in IDs and parse it through that function to strip out all the non-unique ID numbers. Then all you need to do is loop through the new array and do a SELECT on each row to get the corresponding data.

Barebones example:

PHP Code:
$someIDs = array(1,2,2,4,5,6,7,2);
$uniqueIDs array_unique($someIDs);

foreach (
$uniqueIDs as $idNumber)
{
...
MySQL SELECT QUERY HERE...


Hope that helps.

- Mike
__________________
  Reply With Quote