Results 1 to 1 of 1

Thread: LEFT JOIN Issues...

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default LEFT JOIN Issues...

    I have the following query, the bottom line was previously
    PHP Code:
    AND tblrepresentatives.rep_ID LIKE '%$rep%' 
    ... This however gave me any rep number which had say '5' in it, so i got results from '5', '25', '15' etc... Changing it to what it is currently make's the rep search work but kills all the other search fields... I've also tried taking out the %% and keeping LIKE but still breaks the search... Any ideas anybody?

    PHP Code:
    $sql "SELECT tblmembers.*, tblemployment.*,
             tblrepresentatives.FirstName,
             tblrepresentatives.LastName 
              FROM tblmembers 
            LEFT JOIN tblrepresentatives ON (tblmembers.rep_ID = tblrepresentatives.rep_ID)
            LEFT JOIN tblemployment ON (tblmembers.ID = tblemployment.MembersID)
            WHERE tblmembers.FirstName LIKE '%
    $firstName%'  
            AND LastName LIKE '%
    $lastName%'  
            AND Email LIKE '%
    $email%'  
            AND Location LIKE '%
    $venue%' 
            AND State LIKE '%
    $state%'  
            AND Member LIKE '%
    $status%'  
            AND tblrepresentatives.rep_ID = '
    $rep'"
    Last edited by tomyknoker; 07-23-2007 at 11:26 AM.

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
  •