SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 17th, 2002, 02:52 PM
wansen wansen is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 3 wansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Search engine... only one result showed...

I'm using the code of "Developing A Site Search Engine With PHP And MySQL" from DevArticles. I type the keywords "MySQL" it actually should show me 2 results but I have tried it many times still the same, just one result. Anyone can help me to fix this problem? I'm fully copy the code and database to try. Please help me to fix it.

I'm using the code from here.
URL

Reply With Quote
  #2  
Old August 18th, 2002, 04:42 AM
fumi fumi is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Japan
Posts: 9 fumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Remove this line to get all of your results:

PHP Code:
 $articles array_unique($articles); 


This was wiping out other entries that were being stored.

Fumi

Reply With Quote
  #3  
Old August 18th, 2002, 05:38 AM
wansen wansen is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 3 wansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
duplicate 2 same results

But if I remove "$articles = array_unique($articles);" this code, and I enter 2 keywords to search, it will duplicate 2 same results for me. I types this two keywords, "mysql" and "survey". Please help me to fix it.

Reply With Quote
  #4  
Old August 18th, 2002, 05:54 AM
fumi fumi is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Japan
Posts: 9 fumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That's true. However, this search engine is not meant to rival Google. Of course, if you enter more than one keyword, you will get duplicate results. This problem occurs on even the most sophisticated search engines. Personally, it's never been a problem for me. Tell your users to be enter single words in order to get more specific results.

Fumi

Reply With Quote
  #5  
Old August 18th, 2002, 06:56 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Tried using DISTINCT in the MySQL query?
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #6  
Old August 18th, 2002, 01:09 PM
wansen wansen is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 3 wansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy distinct?

Can you tell me where the distinct should be add? Can you write for me?

Reply With Quote
  #7  
Old August 18th, 2002, 01:53 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Sure.

Let's say I have this table:

Code:
    col1    |    col2    
-------------------------
      1     |      a
      2     |      b
      1     |      c
      1     |      d
      3     |      e
      2     |      f


and I use this query:

Code:
SELECT DISTINCT col1, col2 FROM kbQuestions GROUP BY col1


that query would only return 3 rows.. since we're using DISTINCT it only returns the first of each group.. and in this case, we are grouping col1

edit: uh, huh. you can remove the DISTINCT from that query.. now I've confused myself.. what can distinct be used for?

I think distinct works on whole rows or something

Last edited by Lindset : August 18th, 2002 at 01:59 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Search engine... only one result showed...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway