searching in txt

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tsalexey544
Forum Commoner
Posts: 41
Joined: Thu Jun 22, 2006 11:19 am

searching in txt

Post by tsalexey544 »

how can I make a search engine which will search a excel table (which will have some colums name (like: Nama, age,...)).
After the search is finished it will desplay rows which are the most close to the search.


Please help me...
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What language do you want to make it in? Do you want people to be able to upload a file, then search it? Your question is a bit vague.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

Wouldn't it be easier to use one of the currently available databases like MySQL (free) than waste time and effort trying to create your own?
tsalexey544
Forum Commoner
Posts: 41
Joined: Thu Jun 22, 2006 11:19 am

Post by tsalexey544 »

I want to create a search enging that will search not only by keywards but also by age, sex, and so on....
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You may want to research MySQL http://en.wikipedia.org/wiki/MySQL

Excel isn't capable of doing what you want.

Unless of course, it's for a small amount of records and visitors...
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

MySQL would have no trouble with that. Maybe a query such as the following (not tested).

Code: Select all

SELECT `$column1`, `$column2`, `$column3`,
MATCH(`$column1`, `$column2`, `$column3`) AGAINST ('$keywords') 
AS score 
FROM `$tablename` 
WHERE MATCH(`$column1`, `$column2`, `$column3`) AGAINST ('$keywords') 
AND `sex` = '$sex'
AND `age` >= $min_age
AND `age` <= $max_age 
ORDER BY score DESC
tsalexey544
Forum Commoner
Posts: 41
Joined: Thu Jun 22, 2006 11:19 am

Post by tsalexey544 »

I am going to try it THANKS !!
Post Reply