#1
  1. No Profile Picture
    juspin
    Guest
    Devshed Newbie (0 - 499 posts)
    Does anybody know how to eliminate redundant search links?

    If you go to http://johnny.ncolorado.com/index.php3 and do a keyword search on "real estate" you will see that it brings up the same link multiple times. It would be cool if it only brought up one from each company.

    Any help would be appreciated. Thanks a ton.

    Here's the code:


    The code is here: http://johnny.ncolorado.com/searchresults.txt
  2. #2
  3. No Profile Picture
    Kyuzo
    Guest
    Devshed Newbie (0 - 499 posts)
    Knee-jerk reaction would be to say that you might be performing a cross join (a.k.a. Cartesian join) where all the rows of one table are being matched with every row in the other table as a result of as a result of not specifiying the correct condition in the where clause. This might help $sql="select t1.*, t2.* from companies as t1, location as t2 where t1.site_id=t2.site_id and t1.site_id IN (list the site id numbers here that you want to base your search on)" -> try this instead of the LEFT JOIN sql statement you have in there. Also, after briefly looking at your code, is was wondering about the following statement: $sql = "SELECT site_id,category_id,priority,coname,siteurl,sitedescription,category_id IN(category, numbers, here) FROM companies" -> in this case, category_id IN(category, numbers, here) will return every row and either a 1 or 0 for that column depending on whether that category number was found there (1) or not found there (0) it WILL NOT return only those containing the specified category number list. Try "select site_id, category_id, etc. from companies where category_id IN(category, numbers, here)"

    I hope this helps. Happy New Year

    Kyuzo

Similar Threads

  1. Frames hijacked after remote search
    By Telejoke in forum Antivirus Protection
    Replies: 2
    Last Post: September 26th, 2007, 09:32 AM
  2. Hiding search engine optimization links
    By rickvidallon in forum HTML Programming
    Replies: 3
    Last Post: February 15th, 2004, 06:04 PM
  3. Cgi Search feature script
    By butsy_7 in forum Perl Programming
    Replies: 5
    Last Post: January 22nd, 2004, 07:43 PM
  4. Is there any alternative to fulltext search?
    By irishairpics in forum MySQL Help
    Replies: 2
    Last Post: December 10th, 2003, 02:40 PM
  5. Site html search with php?
    By stojan in forum PHP Development
    Replies: 1
    Last Post: November 17th, 2003, 09:20 PM

IMN logo majestic logo threadwatch logo seochat tools logo