Building a Search Engine with MySQL and PHP 5 (
Page 1 of 4 ) If you maintain a medium-sized, growing web site, you might find that it needs an internal proprietary search engine to improve your visitors' experience. This article, the first of three parts, will get you started with building such an engine using PHP and MySQL.Introduction
Being one of the most popular and approachable programming languages used on the web these days, PHP truly provides web developers with the tools for building a vast arsenal of applications which could not be created a few years ago. In truth, database-driven web sites, shopping carts, pagination systems and form validation mechanisms are only a few examples of what can be done with this friendly scripting language. PHP has evolved significantly and now exposes a mature object-oriented model.
However, it's valid to notice that aside from the wealth of web-based applications that can be built quite easily with PHP, there's one in particular that's becoming very popular with many modern web sites as they grow in size. In this case, I'm talking about developing an internal search engine for any web site, by using the capacities provided by the powerful MySQL/PHP 5 tandem.
True to form, web-based search engines have existed for a long time and evolved steadily, mostly due to the continuous advances of large companies like Yahoo, Google, and many others in this huge and fascinating terrain.
Nevertheless, in this case I'm not so ambitious as to tackle the development of such a complex project. Instead, I'd like to focus my attention on a concrete situation that several PHP developers have to face on a frequent basis. They must deal with a medium-sized web site that requires the implementation of an internal search engine, so users can find the contents they're looking for more directly and easily, without the need to navigate across a certain number of irrelevant web pages. Sounds pretty logical, right?
From a theoretical point of view, building this kind of application might seem to be a pretty straightforward process that can be tackled with minor hassles. But in a real-world situation, developing an efficient search engine with PHP 5 and MySQL may be quite challenging, especially if you're a PHP developer making your first steps into the vast area of web development.
Thus, considering that more and more web sites are adding a proprietary search engine to their existing structure, in this series, which is comprised of three instructive tutorials, I'm going to teach you how to build a web-based search application that can be easily adapted to suit your personal needs. Of course, as you may have guessed, I'm going to use some basic MySQL database tables for storing the contents of a hypothetical web site, but this condition can be quickly modified to work with a different database server.
Having introduced the subject of this series of articles, it's time to start learning how to develop an extensible search engine by using the powerful MySQL/PHP 5 combination. Let's begin this instructive journey now!
| | Discuss Building a Search Engine with MySQL and PHP 5 | | | | | | | In this first oart of the series, the basic structure of this PHP 5-based search... | | | | | | Is there a way to weight the results? For example, if the 'firstname' col is a... | | | | | | Thank you for commenting on my PHP article. Regarding your question, it's possible... | | | | | | Excellent, thank you.
(i will probably have some questions for you on that... | | | | | | Again, thank you for your comments.Regards. | | | | | | Again, thank you for your comments.
Regards. | | | | | | This system is WAY too complicated. It really doesn't need to be this complex.
How... | | | | | | Thank you for commenting on my PHP article. Yes, the code sample you listed... | | | | | | I'm not getting any result out of this code and I don't find the assignment for... | | | | | | Thank you for commenting on my PHP article. Actually, this search engine works just... | | | | | | Thanx I knew what's going on now actually it's my fault cause I made a dump mistake... | | | | | | Thank you for the comments on my PHP article. And I'm glad to know you fixed up the... | | | | | | I have all the code as shown and the MySQL is the right type etc, but when I click... | | | | | | Thank you for commenting on my PHP article. Concerning your question, as I expressed... | | | | | | Thank you for writing this tutorial. I am still learning about classes and don't... | | | | | | very nice articles. simple, effective and extremely useful. it's exactly what our... | | | | | | I get this error when I enter a text and press search: "Error performing query... | | | | | | Thank you for commenting on my PHP article. Indeed, the search engine works just... | | | | | | Hi there,
I get the following error message when trying this script:
Warning:... | | | | | | Thank you for commenting on my PHP article. As any other application that uses... | | | | | | Hi I am getting this parse error when trying to run a search.
Parse error: syntax... | | | | | | Thank you for the comments on my PHP article. Concerning your question, the... | | | | | | I agree with you that it can't be your code... has to be me.. as I am not that... | | | | | | Hey Tony,
Thanks again for the comments. It’s clear now what's going on. You’re... | | | | | | Thank you,
ok, I have updated the php version to 5.2.5 as you can see... | | | | | | Hey again Tony,
Now, seems that the source code of all the classes is correct... | | | | | | hi,
I'm also getting the same problem:
"Error performing query SELECT... | | | | | | Hi Sophia,
Thanks for the comments on my PHP article. As I posted before, here’re... | | | | | | I modified a little your code.. when i click the button "search" i see this message... | | | | | | Thanks for commenting on my PHP article. Now, concerning your question, you’re... | | | | | | First i would like to appreciate your effort for writing this article, What i want... | | | | | | I'm here again.
After i supplied my (Host, User, Database & Password )
when o... | | | | | | As I posted previously, the search engine works just fine, and you’re getting that... | | | | | | Thanks for commenting on my PHP article. Yes, you must replace the parameters passed... | | | | | | Hi All,
Please send me any one who has all files checked and free of... | | | | | | I am facing the same problem I have checked all possible reasons as you prescribed... | | | | | | Dear Alejandro Gervasio,
I need to read your complete articles of... | | | | | | Hi again Sayed,
Thanks for the kind words. Here’re the links you requested for my... | | | | | | Hi Sayed,
I already included at the bottom of the page the list of links of each... | | | | | | Great script!!, learning a lot.. can you please help me with this error,
i have... | | | | | | Thanks for the kind words on my PHP search engine. Concerning your question, make... | | | | | | Thank you Mr. Gervasio for great article - it finally works.
I've been trying for... | | | | | | Thanks for the words on my article. Good to know you've fixed up the copy/paste... | | | | | | This is a great tutorial that you have written. I followed on the instructions and I... | | | | | | I cannot seem to find the links at the bottom of the page. Where are they? | | | | | | Hey,
Good to know you liked my PHP article. Regarding your question, you should... | | | | | | Hi this is a very good article for freshers like me...i followed the same procedure... | | | | | | Thanks for the comments. As I mentioned in previous posts, the error you’re getting... | | | | | | Hi
I get fixed this error.Instead of using
SELECT * FROM motors WHERE... | | | | | | Hi, great article.
I am trying to build a search function whereby the user types... | | | | | | Thanks for the comments. Regarding your question, here’s a simple procedural example... | | | | | | For those who are getting "Error performing query SELECT" error, do following to... | | | | | | >>> Post your comment now! | | | | | |
|
 |
|