Home arrow MySQL arrow Page 7 - Developing A Site Search Engine With PHP And MySQL
MYSQL

Developing A Site Search Engine With PHP And MySQL


The key to developing a successful web site is content. Sure, your site can be packed with 10,000 50-page articles, but what good are these articles if your visitors can't find what they're after? In this article Mitchell shows us how to create a site search engine with PHP and MySQL. He develops the MySQL database and PHP script that will allow us to enter several keywords to search dynamic content.

Author Info:
By: Mitchell Harper
Rating: 4 stars4 stars4 stars4 stars4 stars / 145
February 16, 2002
TABLE OF CONTENTS:
  1. · Developing A Site Search Engine With PHP And MySQL
  2. · Search Engine Theory
  3. · Creating the database
  4. · The searchdocs.php script
  5. · The doSearch function
  6. · Testing our search script
  7. · Conclusion

print this article
SEARCH DEVARTICLES

Developing A Site Search Engine With PHP And MySQL - Conclusion
(Page 7 of 7 )

In this article we've taken a look at how to create a basic search engine using PHP and MySQL. Although our search engine is fairly limited in terms of functionality, it isn't too difficult to "upgrade" it so that it can be used on a commercial level content-driven site.

Here are some things you might like to try:
  • Add the ability to search for Boolean keywords such as "mysql AND php" or "php NOT apache". This would involve searching the $keywords variable for AND or NOT and modifying the MySQL query around your findings.
  • Add the ability to span results across multiple pages. Let the user choose to view 10, 20, or 30 records per page.
  • Add a ranking system that ranks each article in the search results. For example, if I searched for "mysql query select", and only one record matched for "mysql", then this record would have a 33% relevance ranking, because it only contained one our of three (or 33%) keywords.
  • Adapt the search so that wild card values can be used instead. You can represent the wild card values using MySQL's LIKE command.
If you'd like to know more about creating a search engine with PHP and MySQL, then check out some of the links and books shown below.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials