Re: [nmsinc] Query to return only empty field results
Hi,
If you are relying on getRecords() automatic search capabilities, this approach wont work. getRecords() in this case will only add independent_adjuster to the query IF a value is present. In your example, it would not be factored into the query at all. If, in this circumstance, you wanted to search for records where this field is blank, you will need to detect that this field has no value, add add it to the WHERE clause manually.
For example:
$where = "";
if (!@$_REQUEST['independent_adjuster']) {
$where = "independent_adjuster = '' ";
}
list($myRecords, $myMetaData) = getRecords(array(
'tableName' => 'mySection',
'where' => $where,
));
Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/