Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Simple Search Script

Posted on 2012-03-09
2
Medium Priority
?
323 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

604 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