Connecting Tech Pros Worldwide Forums | Help | Site Map

Are ampersands in my DB messing searches up?

leegold2
Guest
 
Posts: n/a
#1: Jul 17 '05
If I try to query ie. search via PHP/MYSQL my db for this string:

foo&bar

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 searchable. I'm not sure how. Thanks, Lee G.
Sadara
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Are ampersands in my DB messing searches up?


leegold2 wrote:[color=blue]
> If I try to query ie. search via PHP/MYSQL my db for this string:
>
> foo&bar
>
> 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 searchable. I'm not sure how. Thanks, Lee G.[/color]

i have no problem with:

where <columnname> like '%foo&bar%'
where <columnname> = 'foo&bar'

this seems fine on columns of datatype CHAR, VARCHAR and TEXT.

sadara
Closed Thread