[FX.php List] And OR find
Bob Patin
bob at patin.com
Tue Nov 21 17:24:45 MST 2006
Here's another approach:
Create a calc field called spring_fall that says, if (semester" =
spring or semester=fall;"TRUE";"FALSE")
Then just do a query for the year and for spring_fall to equal "TRUE"
like this:
$query->AddDBParam('year',$year);
$query->AddDBParam('spring_fall','TRUE');
I like to use calc fields to make my web queries easier...
Hope this helps,
Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
CONTACT US VIA INSTANT MESSAGING:
AIM or iChat: longterm1954
Yahoo: longterm_solutions
MSN: tech at longtermsolutions.com
ICQ: 159333060
On Nov 21, 2006, at 5:37 PM, Jerry Do wrote:
> Thanks Steve, That is exactly what I wanted.
>
> Thanks again
>
> Jerry,
>
>
> On 11/21/06 5:33 PM, "Steve Winter" <steve at bluecrocodile.co.nz> wrote:
>
>> 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
>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> 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