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
// 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,
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
[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
4 matches
Mail list logo