argh search with AND, OR, NOT how? ( 4 Views )

no kitty!
  1. Hi I am trying tow rite a search facility (just simple) that can cater for AND, OR, NOT

    Basically the client want a single form field where they can type variations of the following (words and phrases)

    (please excuse my examples just was trying to think up real ones :()

    Quote:

    Black AND White

    British AND French NOT Scottish

    English OR Scottish OR Welsh
    Basically I would like to end up with a series of AND variables, series of OR and a series of NOT. So that I can make up my SQL query using them.

    I wasn't quite sure where to start, as I gathered that I am looking for a reg exp of some sort then placing the AND, OR, NOT into seperate arrays and then creating the SQL query using that?

    Good idea bad idea?

    Thanks for any thoughts as I am struggling

    Or I haven't asked if I can do a drop down box to include the AND OR NOT parts BUT they did draw out what they wanted and that wasn't included, so this is my first option - if its too hard then I will go back to them and alter the page layout.

    Thanks
    Sarah

    (berk, Belize)

  2. I'm always in favor of forcing the user's options, i.e. a dropdown. It's just a lot easier to handle and in some cases is easier on the user as well. If you decide to let them just type it all in, parsing out the operators might be the least of your worries -- operator precedence is where things can get funky. Here's the PHP manual page on operator precedence: http://us3.php.net/manual/en/languag...ors.precedence (I know you're not using PHP but it's all the same). I'd take a look at Google's search tips too, just to get some more information.

    (hüseyin, Mali)

  3. Take a look at this article. The author includes some working good which you can use for ideas:

    http://www.planet-source-code.com/vb...txtCodeId=6707

    (gozde, Egypt)



Related Topics ... (or search in 1.720.883 topics !)

argh! (4)
argh; is it even possible? (9)
argh (1)
argh - how do i do this?? (3)
argh - down and out (12)
argh!!! (3)
argh (7)
argh! (20)
argh (4)




copyright © 2007-2031 Pfodere.COM ( 5 Pfoyihuee Online )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
0.6948