[FX.php List] AND plus OR search

Gjermund Gusland Thorsen ggt667 at gmail.com
Tue Dec 8 16:52:28 MST 2009


Whatever you do, do not forget about
http://php.net/manual/en/function.array-merge-recursive.php

as you might want to combine the two results.

ggt

2009/12/8 Anders Monsen <andersm at alamark.com>:
> Hi Steve,
> That's what I feared.
> A second query does seem to be acceptable.
> Thanks,
> Anders
> On Dec 8, 2009, at 2:09 PM, Steve Winter wrote:
>
> 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
> _______________________________________________
> 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