Re: [PHP] Pulling unique data from database into an array

2004-02-02 Thread Jochem Maas
// given an array in the form: $arrX = array( '6' => 'English||Spanish' '8' => 'English||Portuguese||Finnish' // ...etc... ); // define a new array & loop thru $arrX like so: $arrTmp = array() foreach ($arrX as $langs) { $arrTmp = array_merge($arrTmp, explode('||',

Re: [PHP] Pulling unique data from database

2004-02-01 Thread Adam Bregenzer
On Sun, 2004-02-01 at 21:26, Richard Kurth wrote: > each time it looks at a new record it list all the languages that that > person speaks with a double pipe in between each language. > > What I need to do is find all the unique languages so I can generate a > list of languages that do not have an

RE: [PHP] Pulling unique data from database

2004-02-01 Thread Jonathan Rosenberg
Here's some skeleton code showing one way (untested, no error checking shown): $query = 'SELECT Language FROM whatever'; $result = mysql_query($query); $languages = array(); while ($row=mysql_fetch_object($result)) $languages = array_merge($languages

Re: [PHP] Pulling unique data from database

2004-02-01 Thread Raditha Dissanayake
Hello Richard, Normally the distinct calause in sql serves this purpose but it seems that the way your DB is designed you cannot make use of it. The bad news is that you might have to read all the rows split them by the pipe symbol and insert them into a list manually. ouch! Richard Kurth w

Re: [PHP] Pulling unique data from database

2004-02-01 Thread Jason Wong
On Monday 02 February 2004 10:26, Richard Kurth wrote: > What I need to do is find all the unique languages so I can generate a > list of languages that do not have any repeats in it. so the list above > would be English,Portuguese,Finnish,Japanese,German,Spanish in any > order explode() and arr