ljensen1 Posted October 4, 2007 Share Posted October 4, 2007 :) 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 More sharing options...
ljensen1 Posted October 4, 2007 Author Share Posted October 4, 2007 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 More sharing options...
normanicus Posted October 5, 2007 Share Posted October 5, 2007 Go here: http://sixfriedrice.com/wp/blog/blog-archive and you'll see four articles on the 'The Secret Life of Find Mode'. Very good, Norman Link to comment Share on other sites More sharing options...
ljensen1 Posted October 5, 2007 Author Share Posted October 5, 2007 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 More sharing options...
Genx Posted October 5, 2007 Share Posted October 5, 2007 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 More sharing options...
ljensen1 Posted October 5, 2007 Author Share Posted October 5, 2007 Do you know if I can set that up without the developer version of FileMaker? How do I pass a web-based parameter to a script within FileMaker? Link to comment Share on other sites More sharing options...
Genx Posted October 5, 2007 Share Posted October 5, 2007 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 More sharing options...
ljensen1 Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks. I'll take a look over there. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6175 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 accountSign in
Already have an account? Sign in here.
Sign In Now