[FX.php List] How do I contrain a found set?

Erik Andreas Cayré erik at cayre.dk
Sun Aug 6 06:40:57 MDT 2006


Den 06/08/2006 kl. 5.27 skrev Edward L. Ford:

> Hello all,
> How would one constrain a found set with FX?
>
> In my situation, the database has a group of fields that are  
> considered search able for users, and then there's a special  
> approved field, which can be set to either Yes or No -- end users  
> should only see records that have Yes for the Approved field.
>
> Currently, there is a page for a user to perform a search on  
> multiple fields.  I want to first perform a Find, using the  
> criteria input into an HTML form -- I've already got that figured  
> out.  Now I want to constrain the found set based on if Approved is  
> set to yes or not.  How would I do that?
>
> Right now, I just have $SearchParams->AddDBParam('Approved',  
> 'Yes'); in with the rest of the items input from the HTML POST.   
> Because the search is a logical OR search, having it set this way  
> returns all of the approved records -- since I set the Approved  
> param record to yes, all approved records have that match, and thus  
> are returned, essentially negating the criteria entered by a user  
> into the HTML form.  (Does that make sense to anyone else but me?)

Hi Ed,

My way to get the result you're looking for is to include  
$SearchParams->AddDBParam('Approved', 'Yes'); in the first query.  
This turns the parameter into a logical 'and'.
I know this is not exactly what you asked for since, it isn't a  
second search constraining the found set. I must admit I don't know  
how to do a second search constraning the found set (maybe it's  
irrelevant since another web user might have changed the found set  
with her own query inbetween).
I  do believe however it will be faster as well as easier to get the  
records you need in only one search.



---
Erik Andreas Cayré
Spangsbjerg Møllevej 169
DK-6705 Esbjerg Ø

Home Tel: +45 75150512
Mobile: +45 40161183


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1856 bytes
Desc: not available
Url : http://www.iviking.org/pipermail/fx.php_list/attachments/20060806/b1e92743/smime.bin


More information about the FX.php_List mailing list