[FX.php List] Query Operator question

Dale Bengston dbengston at preservationstudio.com
Fri Dec 29 21:05:13 MST 2006


Hi Alex,

It would be a lot easier if your Trashed field always contained a  
value. The easiest way to do this is to use 0 for false and 1 for  
true. You could have your FMP field definition set to auto-enter 0  
for any new records, and then set Trashed to 1 if you're actually  
trashing a record. Then you could set your search term to
	$lookup->AddDBParam('Trashed', 0);

Hope this helps,
Dale

PS Watch case: I think you need to use 'neq' instead of 'NEQ' for the  
second one. (Just like 'eq' in the line above it.)


On Dec 29, 2006, at 9:53 PM, Alex Gates wrote:

> I'd like to perform a query and bring back only records that don't  
> contain "Trashed" in a field called "Trashed."
>
> I can think of two ways this could possibly work, but none of them  
> worked for me.
> You could add a DB Param that brings back only "" for Trashed -
> like:
> $lookup=new FX($serverIP,$webCompanionPort,'FMPro7');
> $lookup->SetDBData('Web_Cookbook_Dev.fp7','RecipeList');
> $lookup->SetDBPassword('xxxxxx','xxxxxx');
> $lookup->AddDBParam('WebAccountNumber','"'.$WebAccountNumber.'"',  
> 'eq');
> $lookup->AddDBParam('Trashed', '""');
> $lookup->AddSortParam('RecordID','descend');
> $lookupResult=$lookup->FMFind();
> $foundResult=$lookupResult['foundCount'];
>
>
> or using a Query Operator
>
> $lookup=new FX($serverIP,$webCompanionPort,'FMPro7');
> $lookup->SetDBData('Web_Cookbook_Dev.fp7','RecipeList');
> $lookup->SetDBPassword('xxxxxx','xxxxxx');
> $lookup->AddDBParam('WebAccountNumber','"'.$WebAccountNumber.'"',  
> 'eq');
> $lookup->AddDBParam('Trashed', "Trashed", 'NEQ');
> $lookup->AddSortParam('RecordID','descend');
> $lookupResult=$lookup->FMFind();
> $foundResult=$lookupResult['foundCount'];
>
>
> I've had no luck with any of these...
>
> Is my syntax correct?
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list