SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    search condition

    PHP Code:
    and (job like '% teacher%' or job like '%professor%')"; 
    Above code will call ( teachers + professors)


    I like to call (teachers - math teachers).

    I mean that every registered members who entered his job as teachers,
    but exclude math teachers.


    It's something like below

    PHP Code:
    and (job like '% teacher%' and job like '%! math%')"; 
    I don't expect above code does work, but I expect you understand my intention.

  2. #2
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're running MySQL 4+, take a look at full-text search.
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  3. #3
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Where is the full-text search article?

  4. #4
    SitePoint Member
    Join Date
    Apr 2003
    Location
    interNET
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The correct syntax is:
    PHP Code:
    and (job like '% teacher%' and !(job like '% math%') )"; 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •