Completing a Search Engine with MySQL and PHP 5 (
Page 1 of 4 ) 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.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!
| | Discuss Completing a Search Engine with MySQL and PHP 5 | | | | | | | Over the course of this final tutorial of the series, this MySQL/PHP 5 - based... | | | | | | It's a decent simple search engine, but that's all really. It gets tougher when you... | | | | | | Thank you for commenting on my PHP article. You’re correct regarding the simplicity... | | | | | | Getting a grasp on classes in php is difficult for some, like myself, but your... | | | | | | Thank you for the kind comments on my PHP article, and it's always good to know it's... | | | | | | Hi,
Thanks for the detailed tutorial. I began with confidence but I have... | | | | | | Thank you for the comments on my PHP article. Now, concerning your question, the... | | | | | | Hi Alejandro,
Thank you for taking your time to reply. I read your entire... | | | | | | Hi JSP,Thanks again for posting here. Now that you've created a "processform.php"... | | | | | | Thanks Alejandro,
That helps... WOW I wouldn't have guessed that, since I am no... | | | | | | Hi JSP,
Glad to know the search engine is working for you. Thanks again for the... | | | | | | Hi,
I am enjoying working through some of your tutorials am really pretty new to... | | | | | | Hi Joe,
Thanks for the comments on my PHP article. In fact, that’s not a bug of... | | | | | | Great Coding. How to solve the go back "bug"
In the form.htm, add a hidden input... | | | | | | Thanks for the comments on my PHP article and for the contributions to the search... | | | | | | Dear Alejandro Gervasio,
I am a new learner of PHP and MySQL i will be... | | | | | | Dear Alejandro Gervasio
I have read your artical care fully and copy past the... | | | | | | Hi Sayed,,
Thanks for the comments on my PHP article. I took a look at your code... | | | | | | Hi again Sayed,
Thanks for your interest on my PHP article, and I really... | | | | | | Dear Sir,
I copy and past the code for webpage.php class from your... | | | | | | Hey Sayek, are you getting a 500 internal server error? Then, you should check the... | | | | | | Hi Alejandro.
Nice Tutorial!
Can you tell me where the session data is to... | | | | | | Hey Efe,
Thanks for the kind words. I’m not sure to understand entirely your... | | | | | | >>> Post your comment now! | | | | | |
|
 |
|