?
Solved

PHP Simple Search Script

Posted on 2012-03-09
2
Medium Priority
?
300 Views
Last Modified: 2012-08-30
Hi Experts,

I'm in the middle of developing a website, I want a search page that searches through mysql database.

I have 3 text boxes, each of them to search through the database.

Is there any scripts available? I need a simple php mysql search script, if possible?

Any help appreciated. Thanks.

Regards,
0
Comment
Question by:Fezi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
virmaior earned 2000 total points
ID: 37705011
I doubt there's going to be a ready made script for that... but it's not a complex query depending on how many tables you want to search in the background. MySQL has two types of queries that are useful for searching a DB:

1) the LIKE operator --> WHERE column LIKE '%value%';
2) fulltext -> WHERE MATCH
('Content') AGAINST('+keyword1 +keyword2' IN
BOOLEAN MODE) HAVING Relevance > 0.2 ORDER
BY Relevance DESC  [see http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html ]

The advantage of the former is that all you have to do is plop your search terms in. The advantage of the latter is that it can be indexed so it does not kill your database in terms of speed.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 37705065
If your site can generate web pages that expose all of the data in response to a GET method request, you can create a "site map" page and then point one of the popular search engines at it (like Google Site Search).  I have used Freefind, Atomz, Picosearch and a personal favorite, Zoom from Wrensoft.  All have met my search needs adequately.  Since they spider asynchronously and store the results for quick lookup, you do not take a performance hit when people search the site.
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question