Simple search page PHP MySQL fulltext search -


i'm building search page on website.

at first looked @ search engines require vps or dedicated server. i'm on shared server.

so tried mysql fulltext search.

create table if not exists `deck_search_table`( `id` integer not null auto_increment primary key,  `index_date` integer not null, `user_id` integer not null, `username` varchar(70) not null, `deck_id` integer not null, `deck_title` varchar(145) default null, `last_modified` integer not null, `card_one` text not null, `card_two` text not null, `card_three` text default null, `card_count` integer not null ) engine=myisam  default charset=utf8;   alter table deck_search_table add fulltext(card_one, card_two, card_three); 

here's table looks like. can't work. put 2 rows in database. 1 fastidous once , 1 fastidous twice. ran this

select * deck_search_table match (card_one) against ('fastidous') 

got 0 results. removed 1 2 fastidous words , gave me result.

but i'm not sure how works.

basically, how perform search?... , results organized relevant least relevant?

here's example of i'd do.

$timevar = strtotime("today"); $searchquery = "search goods mister search engine";  select * deck_search_table last_modified >=$timevar , match (deck_title,card_one,card_two,card_three) against ($searchquery) 

maybe should use like , not match.

select * deck_search_table deck_title $search_query or card_one $search_query 

(i add card_one can more)


Comments