i'm doin a keyword search on my website... and doesn't seem to work...
on my database table I made my "description" field as mediumtext and I want my description to be searchable by keyword....
on my php search result page i put this ..
and below on that is my sql statement
is there any problem w/ my sql statement? Something's weird because im using the same sql statement for my website name search and it returns result.
how do i search on the description field by keyword that has word inside on that field??
ex. when i search by "test" keyword, i need to display all the website name w/ having a "test" word inside on their desription field.
hope you guys can help me again on this one.. thank you very much for the time.
on my database table I made my "description" field as mediumtext and I want my description to be searchable by keyword....
on my php search result page i put this ..
Code:
//on top of the page
$f_keyword = $_POST['f_keyword'];
//sql search for keyword on description field
if($f_keyword == ""){
// search nothing
} else {
[B]$f_keyword_where[/B] = "AND directory.description LIKE 'f_keyword%'";
}
and below on that is my sql statement
Code:
SELECT tier.id, city.*, state.*,directory.* ,
directory.website_name AS website_name , city.tier_id AS TIER, directory.description AS DESCRIPTION, directory.url AS URL
FROM tier,city,state,directory
WHERE tier.id = city.tier_id
$f_website_name_where
[b]$f_keyword_where[/b]
Group by directory.website_name
is there any problem w/ my sql statement? Something's weird because im using the same sql statement for my website name search and it returns result.
how do i search on the description field by keyword that has word inside on that field??
ex. when i search by "test" keyword, i need to display all the website name w/ having a "test" word inside on their desription field.
hope you guys can help me again on this one.. thank you very much for the time.