[FX.php List] Search problems
Andrew Denman
adenman at tmea.org
Wed Jul 12 08:48:41 MDT 2006
Just to clarify. the 'eq' parameter is working correctly: it is matching the
word "fiction", it's just that FM8 sees "non-fiction" as two words.
You can send any of the special search symbols to FM8 in your search query.
The '=' is an exact match, '==' is a field content match, '.' is a range,
and so on. If you want a for sure match each time, the paranoid way to set
up the search string is:
$type = '=="' . $_GET['type'] . '"';
$FMQuery->AddDBParam("Category", $type, "eq");
It would be like entering '=="non-fiction"' in a FileMaker client.
Andrew Denman
_____
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Kevin Futter
Sent: Tuesday, July 11, 2006 11:50 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Search problems
On 12/7/06 2:04 PM, "Bob Patin" <bob at patin.com> wrote:
Kevin,
Here's another approach; change the line
$FMQuery->AddDBParam("Category", $type, "eq");
to
$FMQuery->AddDBparam('Cateogry','=='.$type);
and you'll get an exact match every time.
Thanks Bob. I actually solved it using something very similar to this; I
merely changed:
$type = $_GET['type'];
to
$type = "=" . $_GET['type'];
Works like a charm, though it feels really hacky. Not sure why it works with
prepending only one "=", but I'm not arguing at this stage. I considered the
"grab all records and let PHP sort 'em out" approach, but was looking for
something a little more direct.
Thanks again to everyone for their suggestions. Great list this one!
--
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060712/908c4656/attachment.html
More information about the FX.php_List
mailing list