Solved

PHP Simple Search Script

Posted on 2012-03-09
2
293 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 500 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 110

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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