Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keyword search ..help 1

Status
Not open for further replies.

Keendev

Technical User
Joined
Jan 23, 2006
Messages
106
Location
PH
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 ..
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top