[FX.php List] Query Operator question

Gjermund Gusland Thorsen ggt667 at gmail.com
Sat Dec 30 06:36:04 MST 2006


This is how I do it:
---
Prospect( when any user submits data to the database I but the value
10 in the field webValid )
$q->AddDBParam( 'webValid', '10' );

If the information is incomplete I change the status to 0 or leave it at 10
$q->AddDBParam( 'webValid', '0' );

If the info is complete I make the value 1
$q->AddDBParam( 'webValid', '1' );


On 12/30/06, Dale Bengston <dbengston at preservationstudio.com> wrote:
> 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
>
> _______________________________________________
> 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