Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    2

    Unanswered: Match() with between won't work...

    Can anyone tell me how to get this SQL query to match only those records that are in-between the range $left & $right:

    Code:
    SELECT MATCH (JobDescription,JobTitle) 
    AGAINST (\'' . $this->keywords . '\' IN BOOLEAN MODE) 
    AS score, JobDescription, JobTitle, DatePosted, 
    FROM Adverts 
    WHERE MATCH (JobDescription,JobTitle) 
    AGAINST (\'' . $this->keywords . '\' IN BOOLEAN MODE) 
    AND Region BETWEEN '.$left.' AND '.$right.'
    ORDER BY score DESC;
    The match() works, that is not a problem, the only problem I have is getting it to match specifically between $left and $right which are simple integers.

    I've used the nested set model to define my regions table.

    I've checked all my php variables and they are all the correct values, I've tried any number of variations of this SQL using HAVING and changing the order, I've looked in the MySQL docs and can't find anything to help me out.

    Do any of you know what I am doing wrong?

    Thanks

  2. #2
    Join Date
    Jun 2006
    Posts
    2
    No worries problem solved, it's too embarrasing even to say what it was, but I can appreciate that I can't just leave the post like this:

    I was running two queries, if the first one didn't find anything the second would kick in, well guess what was happening...

    Nice

    Sorry, but thanks for your time anyway.

Posting Permissions

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