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

special characters in searches

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
If I try to query ie. search via PHP/MYSQL my db for this string:

NA&SD

It will not find the string with either FullText or a sub-string search (ie. %NA&SD% ). I think the ampersand is messing things up? If you were to implement a search via PHP of MYSQL records what would you do to make this string search able. I'm not sure how. Thanks.
 
The ampersand is not a special character in SQL. Can you query the record from the mysql shell? What type of field is it stored in?
 
text and varchar. It's giving strange results when I post a string with an ampersand embedded in it an do a search in a MYSQL DB. I think the fix is to use htmlspecialchars BEFORE I post within the inital form. But I don't know how - i have a sthread asking how to do this in the PHP forum. See all problems go away when I use & in the search form and post that. So I you have the time see my ques. in the PHP thread. Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top