SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Query Returns......

    Hi Chaps,

    the below query is returning one row (of the same) too many. the result is correct, but its outputing it twice. can someone please correct me?

    Code:
    $query="
    SELECT
             server.ID, server.IPAddress, server.ServerName, server.MakeORModel,    
             server.Department, server.MoreInfo, server.CreatedDate, 
             servermoreinfo.ServerID, servermoreinfo.ServerType
    FROM
    	server, servermoreinfo
    WHERE
    	server.ID=servermoreinfo.ServerID
    AND
    	servermoreinfo.ServerType='$SearchType'
    OR
    	server.IPAddress LIKE '%$SearchTerm'
    OR
    	server.MakeORModel LIKE '%$SearchTerm'
    OR
    	server.Department LIKE '%$SearchTerm'
    OR
    	server.CreatedDate LIKE '%$SearchTerm'
    OR
    	server.ServerName LIKE '%$SearchTerm'";
    Thanks

  2. #2
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    managed to get it working.

    thanks

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what was the solution?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •