Solved

PHP Simple Search Script

Posted on 2012-03-09
2
289 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
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 108

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now