Re: Characters causing problems in search strings?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 16, 2009 at 5:40 PM, Miller,
Terion<tmiller@xxxxxxxxxxxxxxxxxxxx> wrote:
> My little browse /search restaurant project is coming along, but I just
> noticed that any restaurant with a &, () or # in the name like say for
> example Arby's Store #12 ...will not return results... Yet if a name has a /
> or a - it's not a problem...
> 1. why is this and how do and where do I escape those characters on the
> query? Or on the insert?
>
> Thanks in Advance
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

There are really two approaches:

1. filter the data (remove the characters you decide you don't want in
there and are irrelevant)
2. encode them to store them

Personally I lean towards removing the unwanted characters. The main
reason is that you then can do a better job of controlling the data
when a query is made, spaces or other characters that are in the name
can result in queries that don't return any data because there is no
exact match

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux