[FX.php List] [OFF] How does the List function work?
DC
dan.cynosure at dbmscan.com
Tue Nov 27 13:31:47 MST 2007
list() is not what you are looking for.
you need to understand the FX returned array - it holds all the data you
need.
i believe that the FX documentation has info on that.
FX returns a complicated, nested array for each find request. in PHP,
you take that array and do whatever you want with it. when you read the
docs, you'll see that the FX array has a 'data' element that is another
array that lists all the records keyed by recid and modid. inside each
of those is another array. just loop over that in a foreach and build
your list inside the foreach.
there are many examples of using foreach to loop over the fx returned
result (in the archives). there was a searchable archive link posted a
month or two back...
here is one that should give you the general idea:
foreach ($fxResult['data'] as $record) {
echo $record['fieldName'][0].',';
}
HTH,
dan
Carl Anderson had written:
> Good day, list:
>
> I'm trying to get the contents of a single field across all records in a
> layout, and put those values into a list in a single field in a different
> table. In other words, the field on all records is "exam1" and I want the
> "exam1rawscores" field in a separate layout to be something like this:
>
> 10,9,9,5,10,3,1,10,6,7,8,2
>
> Heck, the commas aren't even important--I'd be fine with the carriage
> returns that (I believe) List() delivers.
>
> Which leads to my question: How can I get List() to do what I want? Or am I
> going about this all wrong?
>
> The function reference isn't terribly clear to me, someone who hasn't done
> much scripting before.
>
> Sorry for the off-topic nature of this. I'd do all this calculatin' in
> FX.php, but sadly there's too much data to pull in.
>
More information about the FX.php_List
mailing list