Jump to content

Complicated Find


This topic is 6106 days old. Please don't post here. Open a new topic instead.

Recommended Posts

:) I'm using FX.php with FM7. I'm trying to set up a combination and/or Find and I can't come up with coding that works.

These are my parameters:

$search_resource->AddDBParam('Keywords',$Keywords);

$search_resource->AddDBParam('Title',$Title);

$search_resource->AddDBParam('Located',"CALS");

$search_resource->AddDBParam('Located',"CCS");

I want to find all records that have the entered Keywords and Title, AND that are located either in CALS or in CCS. (The user can choose to search for only CCS, only CALS, or both.

Any ideas how I can accomplish this?

Thanks!

Link to comment
Share on other sites

I've been doing more research and it seems that FM won't let me do a combined and/or search from the web. I've run across two possible solutions:

1) use scripts within FileMaker to do the search

2) use more than one web query and combine the results

Questions:

- Can I use option 1 if I don't have the developer version of FM7? How do I pass a parameter to a script in the database?

- For option 2, how do you combine search results? And how do you retain the ability to "linkNext", etc?

Link to comment
Share on other sites

Thanks, but my problem is not doing a Find from the database. I can do it that way easily. I'm trying to figure out how to do it over the web using FX.php. I've even tried using "neq" as part of it:

$search_resource->AddDBPara('Keywords',$Keywords);

$search_resource->AddDBParam('Title',$Title);

$search_resource->AddDBParam("Located","CALS","neq");

- but that just pulls all the records. Seems I can't combine "neq" with another type of operator and get a correct find.

Link to comment
Share on other sites

Well, you can try using:

$search_resource->AddD BParam('Keywords',$Keywor ds);

$search_resource->AddD BParam('Title',$Title);

$search_resource->AddD BParam('Located',"CALS");

$search_resource->AddD BParam('Located',"CCS");

$search_resource->addDBParam('-lop','or');

And that will return records where any of those criteria are true.

Your only other option if you need an "and" for some criteria and an "or" for others is to pass the request to FM via a script and parameters, execute a script and return the RecordID's or Primary Key's of all the records that match that request in a simple delimited array... then dynamically generate a second request in php and do an or search on all of those.

Link to comment
Share on other sites

The developer version has nothing to do with this, script parameters are a standard feature.

You pass the parameters in via FX (don't ask me how as I'm only proficient with the PHP API), then within your fm script you retrieve them using: Get(ScriptParameter).

At the end of the script, you would pass all the id's back by using the exit script step and specifying the delimited information as the script result.

Finally you would retrieve that script result via FX (again, don't ask how, but i'm 95% sure its possible) and perform the necessary searches.

Anyway, for more help with FM/PHP interaction, try this forum: http://fmwebschool.com/frm

Link to comment
Share on other sites

This topic is 6106 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.