GS_ Posted October 23, 2006 Report Share Posted October 23, 2006 Taisiju meklesanu pa datubazi FROM tabula WHERE field1= 'filtrs' AND field2 LIKE '$Search%' OR field3 LIKE '$Search%' Kad mekleju pec parametra kas atbilst tikai field2 tad viss ir normali bet kad mekleju pec parametra kas atbilst field3 tiek ignorets uzliktais filtrs uz field1. Gribu meklet vairakos fieldos bet tikai tos datus kas atbilst uzliktajam filtram. Cerams izteicos pietiekami skaidri ;) Link to comment Share on other sites More sharing options...
Delfins Posted October 24, 2006 Report Share Posted October 24, 2006 Lieto iekavas, tāpat kā matemātikā... Link to comment Share on other sites More sharing options...
andrisp Posted October 24, 2006 Report Share Posted October 24, 2006 Hm.. man pat grūti izpārsēt savā prātā, kādi rezultāti var būt no x OR y AND z. :) Link to comment Share on other sites More sharing options...
Delfins Posted October 24, 2006 Report Share Posted October 24, 2006 (edited) Pēc specenes... http://dev.mysql.com/doc/refman/4.1/en/ope...precedence.html PS: tāpēc arī jālieto iekavas To override this order and group terms explicitly, use parentheses Edited October 24, 2006 by Delfins Link to comment Share on other sites More sharing options...
bubu Posted October 24, 2006 Report Share Posted October 24, 2006 Kāpēc grūti, andrisp? Tas taču tāpat kā matemātikā x + y * z. (tb AND=* un OR=+). Link to comment Share on other sites More sharing options...
andrisp Posted October 24, 2006 Report Share Posted October 24, 2006 hm.. tagad kad skatos, tad viegli. laikam nebija vēl kārtīgi piecēlies :). Link to comment Share on other sites More sharing options...
Recommended Posts