Search Functions

Discussion in 'OT Technology' started by TRN, Oct 14, 2007.

  1. TRN

    TRN Well-Known Member

    Joined:
    Aug 22, 2003
    Messages:
    55,039
    Likes Received:
    125
    Location:
    North East
    Is there a default that a search function using mysql has for special characters?

    % is the wild card

    What about for "AND" and "NOT"?

    Anyone know?
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    WHERE myTextField LIKE '%abcd%' AND NOT LIKE '%xyz%'

    etc
     
  3. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    lol

    SELECT `handle` FROM `users` WHERE ('SQL' > `proficiencies` AND 'Google' > `proficiencies`) ORDER BY `handle` ASC;

    1 Record Returned:
    handle:
    TRN
     
  4. TRN

    TRN Well-Known Member

    Joined:
    Aug 22, 2003
    Messages:
    55,039
    Likes Received:
    125
    Location:
    North East
    Right now I have this:


    SELECT number, subject, class
    FROM blablabla
    LEFT join bla.class USING (ID)
    WHERE (blabla LIKE '%#attributes.search#%' OR subject LIKE '%#attributes.search#%' OR columnnameblabla LIKE '%#attributes.search#%')
    ORDER BY displaydate DESC


    So you are saying I have to add in:
    AND NOT LIKE '%#attributes.search#%'

    That will allow a user doing a search to use AND or NOT in their criteria...

    ?
    :confused:
     
  5. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    basically
     

Share This Page