$find->addFindCriterion('Your_Field', '"' . $search_value . '"');
or for exact match of a word or phrase...
$find->addFindCriterion('Your_Field', '=="' . $search_value . '"');
Basically the API hands off the values in filemaker to perform the find, so you can cat wildcard characters into your values.
Yes thats the expected result…
This is the result produced when running the find command from php
$find->addFindCriterion('Your_Field', $search_value );
where $search_value =
10-010 -> matches: 10-010, 10-0101, 010-01011
=10-010 -> matches: 10-010, 10-010 anything, but not 10-0101
==10-010 -> no records found
"10-010" -> no records found
The server is running FileMaker Pro server 11 on OS X 10.7.
It would be much appreciated if someone could verify if the error is produced from OS X 10.7 (running on MacPro where 10.7 is max), or if it's fixed with FileMaker Pro server 12 (still running on 10.7)?
Are the fields defined as text fields?
I wonder if you need to excape the minus... maybe it is trying to do maths.
10-010 -> matches: 10-010, 10-0101, 010-01011 ## This is a begins-with or contains and should find 10-0102
=10-010 -> matches: 10-010, 10-010 anything, but not 10-0101 ## by anything do you mean it will find 10-0102 ?
==10-010 -> no records found ## exact match so should find 10-010 and nothing else
"10-010" -> no records found ## literal match so should find 10-010 and nothing else
interesting... do you want to post an export from that field so I can experiment. (If I do it with data I enter I might miss something.)
You can search via the PHP API using quote marks and achieve the same result as you can using the FileMaker Pro client - however you need to make sure your PHP installation isn't altering the input values that contain the quote marks (you can see this for yourself if you add some debugging code to the results page to show the raw HTTP REQUEST values. e.g. by adding this to the bottom of the page:
<pre><?php print_r($_REQUEST); ?></pre>
I've encountered an issue with some servers where the magic_quotes_gpc setting in the php.ini file is turned ON - this will prevent your "exact match" searches from working as expected. I would first check to see if the magic_quotes_gpc setting in the php.ini file is ON - if so set it to OFF and try again (restart Apache in between).
Otherwise examine what the actual REQUEST values are and that might give you a clue as to why they're not working, e.g. quote marks getting escaped etc.
They are text fields.
Everything works when the same database files are upgraded to FileMaker Pro 12 Server, running on Mac OS X 10.8.5.
I guess the problem are related to OS X 10.7 or the combination 10.7 and FM Pro server 11.
magic_quotes_gpc, _runtime and _sybase are all Off in FileMaker Pro server php.ini.
Also verified with
The result are the same when the find command are hard coded in the php-file.
The problem is gone when running the same php-files and FM Pro database files on FM Pro Server 12 and OS X 10.8.
I guess the problem are OS X 10.7 (which are the limit on the current webserver harware), or the combination 10.7 and FM Pro Server 11.