You're a star!
Ok, i'll try an explain it a little better, i have a table named 'products', this contains four columns: Make, model, variant, price. i also have another table called 'models' which contain all the models for a specific make. Now this is where it get's a little complicated, the 'products' table may not contain data on every model in the 'models' table.
When a user clicks on a make, it selects * from models where make = #makeSelected# and returns my string (myCSVlist), what i'm trying to do now is to cross reference that list of every model that exists with those that exist in the products table (as some models may not be uploaded yet or may not have any data for them etc), and this i've been able to do so far, the problem is when i display the selection from the 'products' table i have multiple models in the array (as expected). For instance, a user selects, say, a BMW, this would return all models that BMW have from the 'models' database (1-Series, 3-Series, 5-Series etc) and this gets put into my CSV string and passed to the 'products' table. Now when this is returned i have multiple models but different variants, ie: 3-Series Sport, 3-Series Coupe, etc, but my list on the front site only needs to display one of each type of model with the variants looping through underneath them, then the next model would be displayed, for example, 5-Series, with all the variants under that, then 6-Series and so on. With the array i'm getting at the moment it populates my list with 3-Series - variants, then next one would be 3-Series - variants etc etc because it contains multiple models.
So, myCSVlist (from models table) would look something like this 1-Series,3-Series,5-Series,6-Series,7-Series,9-Series ( i think that's all that BMW do
) and that would return an array from the products table which if the model coulmn was converted to CSV would look something like this: 1-Series,1-Series,1-Series,3-Series,3-Series,3-Series,5-Series,5-Series,5-Series,5-Series,5-Series,6-Series,6-Series,6-Series,6-Series,6-Series, (other models are not entered because they haven't got data or some other reason etc) becuase these all have different variants assosiated with them, and each entry needs a seperate row to conatin the data associated with it.
So, i need "filter" the list from 'models' (myCSVlist) to only have one of each type of exsisting model from the entries that exsist in the 'products' table. Whether this loops through a query, does some magical cross referencing or whatever, i'm yet to figure out!
I hope that's clear, i'm not too good at explaining things, if you need more info i could give you a URL as an example of what i'm trying to achive? Maybe i need to restructure my database.... mmmm, hope not
So basically i need to eleminate any non-existing models in the myCSVlist by cross referencing the products table, so if myCSVlist was: 1-Series,3-Series,5-Series,6-Series,7Series,9-Series, and i only had 3-Series,5-Series and 6-Series in my products table, the list needs to become 3-Series,5-Series,6-Series, not multiple results like i'm getting at the moment.
Phew! That's a lot
Bet you wished you'd never asked now lol
But seriously, just wondered if this could be done or if i'm going about it the wrong way competely??
Any help you could give me will be gratefully recieved! And thanks so much for taking the time to answer, it's really been a big help