Home arrow MySQL arrow Completing a Search Engine with MySQL and PHP 5

Completing a Search Engine with MySQL and PHP 5

Building database-driven web sites is one of the most popular trends today in web site development. However, this approach implies that potential visitors must be provided with a straightforward mechanism that allows them to search through web site content. This three-part series walks you through the process of building an expandable search engine by using the combined functionality of MySQL and PHP 5.

TABLE OF CONTENTS:
  1. Completing a Search Engine with MySQL and PHP 5
  2. Listing the full source code of the original search application
  3. Defining a simple web page generating class
  4. Developing a fully-functional practical example
By: Alejandro Gervasio
Rating: starstarstarstarstar / 12
August 13, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

As you'll possibly recall, over the course of the preceding article of the series I defined a couple of basic MySQL-processing classes. These classes came in handy not only for performing different search queries against one or more selected databases, but for displaying the corresponding results using chunks of paginated data. I used the object-oriented paradigm to develop the search engine, but this isn't mandatory since the same level of functionality can also be achieved by utilizing a procedural approach.

Having clarified that crucial point, aside from refreshing some important concepts concerning the development of this MySQL-based search engine, I think now is a good time to discuss the topics that I plan to address in this last installment of the series. This way you'll know what to expect from this tutorial.

In the previous article I showed you how to spawn the results returned by a specific search query across different web pages, so in this last part of the series I'm going to complete this search application by fixing a concrete issue associated specifically with paginating MySQL data sets. Put in a simple way, each time that a user performs a search and then clicks on the paginated links to browse the corresponding results, the original search string passed to the application is simply no longer available in subsequent web page requests. This is something that can quickly break the functionality of the search engine.

Of course, there are many ways to solve this problem, such as appending the search terms to the query string generated by the corresponding paginated links. However, in this case I'm going to take a slightly different approach, and use a simple session mechanism to maintain the value of the search string across different web pages. Naturally, you're free to use the method that best suits your personal needs.

All right, with the preliminaries already out of our way, let's take the last step involved in building this MySQL-based search engine. Let's get started!



 
 
>>> More MySQL Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

MYSQL ARTICLES

- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: