473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do implement search option in php

Hi

I need to implement search option in php page. I need the best method used to implement this feature.
I Followed the following steps to include search option. But i don't whether is best.

(i) In mysql database , each table contains a field 'keyword' ,'url'. Records relevant to the typed text is fetched and if it is clicked , the target url is fetched from the database and displayed. But it might be tedious for more data.

I need the best and actual method used to implement search option in a portal.

Thanks in advance
Somaskarthic
Dec 25 '06 #1
4 5648
Atli
5,058 Expert 4TB
Not really shure what you mean but ok...

Searching isn't really done in php, it would be done in the database. MySQL has some nice search features.

This is a nice simple way to search a MySQL table, but works quite well in my exerience.
Note: this is case insensitive.

Expand|Select|Wrap|Line Numbers
  1. SELECT data FROM table WHERE column LIKE '%keyword%';

If you want the more advanced option, Fulltext searches are also possible in MySQL. Fulltext search is more advanced, not returning only when a keyword is found but also returning related text.

Before you use fulltext search you must define a Fulltext index in your table, for an existing table you'd want to alter it thusly:

Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE tablename
  2. ADD FULLTEXT INDEX (columnname)
Then when you want to search you could use a qyery that looks something like this.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM tablename WHERE MATCH (columnname) AGAINST ('keyword')
Hope this helps :-)
Dec 25 '06 #2
mainul
51
send me ur table sturcture and let me know what do u want to display. let me help u !!
Dec 26 '06 #3
ronverdonk
4,258 Expert 4TB
See same question/posts in forum How to search a pattern in MySQL

Ronald :cool:
Dec 26 '06 #4
send me ur table sturcture and let me know what do u want to display. let me help u !!
Would you be able to help me implement a search function for my data?
Jan 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: amoona | last post by:
Hi… I’m doing a search page form my work for their library. Since this is the first time I work with ASP I’m facing some problems. Each library item has different search data, I was able to...
12
by: Achim Domma (Procoders) | last post by:
Hi, I've seen that there are implementations of Mock objects, which implement interfaces on-the-fly during execution. Could somebody point me to the direction on how to do that in .Net? I...
8
by: Someone | last post by:
Hi, I wish to use a dictionary.com search box and want the results of a search to open in a new window. Is there a way to do this using their code? The copy and paste code is provided below. ...
1
by: Sheau Wei | last post by:
Below is my search engine code. I realize that the function was very limitied because i cannot searching the "NamaPealatan"(name of tools) compatible to the either categories Operasi or Balai or...
3
by: Sheau Wei | last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code? Thanks <Table cellspacing=1 cellPadding=1...
19
by: bb nicole | last post by:
Below is my search engine for job portal which jobseeker can find the job through quick search. But it cant work... Is it mysql query got problem?? Thanx.. Interface <html> <head> <title>UMS...
10
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
5
by: agarwalsrushti | last post by:
hi, This is my the search code i have tried it works well with the fiels stores as string in the database. But i have stored the qualification and specialization as int in database. Each selected...
12
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.