[FX.php List] And OR find
Steve Winter
steve at bluecrocodile.co.nz
Tue Nov 21 16:33:08 MST 2006
Hi Jerry,
So if I understand correctly you want to find (for example)
( year = 2007 AND (semester = spring OR semester = fall))
If so, then you can't do that with one FX.php query (as far as I know).
You've got a couple of options...
1. do two queries, (year = 2007 AND semester = spring) then (year = 2007
AND semester = fall), then join the two result sets using PHP, or simply
output them independently...
2. do one query, (year = 2007), then use PHP to filter just the results
that you want eg
foreach($results as $key => $value) {
if($value['semester'][0] == 'spring' || $value['semester'][0] == 'fall') {
// do some stuff with the recrods, or put them into a new array or
something
} }
3. create a script in FMP that performs the serach, then pass those
results out...
Depending on exactly what you want to do with the output, and the number
of records in question, then I'd be inclined to go with either option 1 or
2...
Cheers
Steve
> Hello,
>
> I want to do a find for Year and (Fall or Spring).
>
> I'm using the following, but it didn't work.
>
> $q->AddParam('Year',$year);
> $q->AddParam('Semester','Fall');
> $q->SetlogicalOR();
> $q->AddParam('Semester','Spring');
>
> Can it be done? If so, please point me to the right direction.
>
> Thank you in advance,
> Jerry
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list