[PHP] Pulling unique data from database into an array

2004-02-02 Thread Richard Kurth
I am pulling data from a database that list the Language a person speaks and the id number. It is in a format like this. user_idfield_value 6English||Spanish 2English 8English||Portuguese||Finnish 5English||Japanese||German 3

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,

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

2004-02-02 Thread Richard Kurth
Hello Jochem, I tried what you suggested and it work just perfect as long as i made the array by hand. But when I try to generate the array using the database I can not get it to work. How would I create the array $arrX from the mysql database. I have tried this but it does not work properly while

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

2004-02-02 Thread Matt Matijevich
[snip] while (!$recordSet-EOF) { $arrX = $recordSet-fields['user_id'] = $recordSet-fields['field_value']; $recordSet-MoveNext(); [/snip] while (!$recordSet-EOF) { $arrX[$recordSet-fields['user_id']] = $recordSet-fields['field_value']; $recordSet-MoveNext(); } -- PHP General Mailing List