[FX.php List] Confusion with 'not equals' search

Chris Bisgard chris at hotanvil.com
Wed May 9 11:40:32 MDT 2007


This doesn't specifically address Roger's questions about how 'neq' works,
but it raises a related issue I've been wondering about myself... 
 
I have solved similar problems to this one by running the first part of the
query with FX, then using the -script parameter in FX to run a very simple
FileMaker script that constrains my found set to satisfy the second part of
the query. However, I seem to recall some of you on this list advising
against having FX run FileMaker scripts, and I'm wondering why. I know that
I can have FX pull the widest data set and then use PHP to whittle it down
from there, but the FM script method is pretty easy and seems to work fine.
I currently have three production scripts handling mixed-type "and/or"
queries in this way, and I have been unaware of any negative effects.
Conversely, I assumed that having FX pull a much larger found set than I
need, then filtering the records in PHP, would actually be the bigger
performance drag of the two. Is that wrong? There's a good chance I don't
know what I'm talking about here...
 
Since there's a strong likelihood I'll be doing more of this in the future,
I wondered if anyone would care to back up their belief in one of these
methods over another for mixed-type and multiple-'neq' searches, in terms of
best practice?
 
Thanks,
Chris
----------------------------------------
Chris Bisgard
Information Technology Specialist
Regional Arts & Culture Council
108 NW 9th Avenue, Suite 300
Portland, Oregon 97209-3318



  _____  

From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Dale Bengston
Sent: Wednesday, May 09, 2007 8:29 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] Confusion with 'not equals' search


I think this is a headache related to FileMaker, and I would recommend using
one of two work-arounds: 

1. Make a calculation field in your table that flags records that are not in
either of the categories you're trying to exclude. Search on the flag field.

2. Retrieve all the records in your query, and use PHP to filter out the two
classifications before you display.

Hope this helps,
Dale

On May 9, 2007, at 9:47 AM, Jonathan Schwartz wrote:


Did anyone answer this question?

I was going to answer with what I understand to be the case...that fx.php
will only execute the last query submitted for a given field, and ignore the
previous query. That would render a multiple query on a single field
non-functional.

Or..perhaps it is the opposite...fx.php accepts just the first query and
ignores the second.

I wanted to see how more experienced users responded.

Jonathan

At 5:31 PM +0100 5/8/07, Roger Price wrote:

I have a simple database with a 'classification' field which contains the
the values:

event

lectures

seminar

news

vacancy

I want to list all records that are neither news nor vacancy so I add the
request lines

$Query->AddDBParam('classification', 'news', 'neq');

$Query->AddDBParam('classification', 'vacancy', 'neq');

The default logical operator is 'and' so I would expect a find to return
just 'events', 'lectures' & 'seminars' because these are not equal to news
and not equal to vacancy, but I get all records returned.

If I add:$Query->AddDBParam('-lop','or');


I just get a couple of 'vacancies' when I would have expected the full
dataset including 'vacancy' and 'news because 'news' should be selected
because they are not vacancies, and vacancy because it is not 'news'.
Everything else should be included because it is neither!


I am obviously missing something important and I know that multiple
negatives can be confusing. When I only use one 'neq' it behaves as I
expect. Is this a limitation of FX.php?


I realise that there are other ways to achieve what I need but I would like
to undersatand how 'neq' works!


kindest regards


Roger






_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list



-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852
FileMaker 8 Certified Developer
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20070509/d52bbb3e/attachment-0001.html


More information about the FX.php_List mailing list