In message <[EMAIL PROTECTED]>, rkw1956 <[EMAIL PROTECTED]> writes >--- In php_mysql@yahoogroups.com, Pete <[EMAIL PROTECTED]> wrote: > >> >> Your problem is that you have designed your database incorrectly.
>Thanks Pete. I've already done the type of design you mention before, >but a very experienced database programmer (certainly more >experienced than I am)suggested using one field with comma separated >values, and then to extrapolate the values once returned from a >database query. But he won't tell me how he did it. I was guessing it >was by using some form of array function, but I'm a total newbie to >these. > >Just hoped someone could explain how it was done. > >Thanks again for your response. > >Richard Then unless you are not telling us something, I repeat, it's just wrong. It's the kind of design that I might have used when I was starting database design, in the 80s! What happens to your database if Jaguar go out of business? You have to visit every business, and check each one to see... oh, well. OK, whine over... <G> There is no simple way to do what you are trying to. You will have to loop through each record. Obviously we all have our own method of collecting data. So assume that you have something like while (looping) (collect $company, $makes...) $makesarray=explode( $makes, ',' ); Then when you have $makes as "Jaguar, Rolls, Ford", and $makesarray[0] is "Jaguar" $makesarray[1] is "Rolls" $makesarray[2] is "Ford" Then use your standard PHP array functions on $makesarray. Does that take you in the direction you want to go? -- Pete Clark Advertise your events in Spain - local and free http://hotcosta.com/events.php