|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Remove this line to get all of your results:
PHP Code:
This was wiping out other entries that were being stored. Fumi |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
Tried using DISTINCT in the MySQL query?
__________________
Best Regards, Håvard Lindset |
|
#6
|
|||
|
|||
|
Can you tell me where the distinct should be add? Can you write for me?
|
|
#7
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Search engine... only one result showed... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|