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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LIKE AND ignore HTML Tags

Status
Not open for further replies.

bdichiara

Programmer
Oct 11, 2006
206
US
Is it possible when using in a query:
Code:
"WHERE fieldname LIKE '%$mysearch%'"
to ignore HTML Tags in the database. For example:
Code:
$mysearch = "h1";
"WHERE content LIKE '%$mysearch%'"

Also, is LIKE case sensitive? So searching for:
search: Jones
returns: jones & Jones & JoNeS

or does it only return: Jones

Thanks.


_______________
 
LIKE is case-insensitive

to avoid search results including html tags, you might want to consider storing a plain-text as well as an hmtl version of the content -- search the plain text version, and return the html version

searching just the html version is going to kill you if you don't want to return results for things like class names, comments, etc.

r937.com | rudy.ca
 
Good suggestion, I'll have that a try. Thanks.

_______________
_brian.
brian_bar.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top