[FX.php List] AND plus OR search

Steve Winter steve at bluecrocodile.co.nz
Tue Dec 8 13:09:49 MST 2009


Hi Anders,

Short answer: No

Long anser: No...!

Well, there is a slightly longer answer...

What you need to do is figure out which query will return the smallest set of results, then use PHP to do the second aspect of the query. In pseduo code... 

Assuming that a search for B = Y OR C = X will return the smallest found set;
	foreach($result)
		if(A = X)
			do something

Alternatively, if A = X returns the smallest found set, then you need to;
	foreach($result)
		if(B = Y OR C = X)
			do that thing

Hope this helps...

Cheers
Steve


On 8 Dec 2009, at 20:04, Anders Monsen wrote:

> I think my mysql background is clouding my FX attempts...
> 
> Is it possible to search for something where the conditions are as follows:
> 
> where field A contains value 'X'
> 	and
> 
> field B contains value 'Y'
> 	or
> field C contains value 'X'
> 
> I believe a pure OR search would find across A or B or C having the values, but I want to have field A and then one of the other two fields.
> 
> --
> Thanks,
> Anders Monsen
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Steve Winter
steve at bluecrocodile.co.nz
m: +44 77 7852 4776
3 Calshot Court, Channel Way
Ocean Village, Southampton SO14 3GR

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20091208/c9aed8cc/attachment-0001.html


More information about the FX.php_List mailing list