Re: Mysql like and stripslashes strangness... Help :)

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

 



Hi Gale,

why don't you stripslashes before you add the %??

Anyway, don't put the % infront, this will make all indexes useless and slow
down your querry dramaticly!!

Cheers,

Merlin


"Allens" <ateam3@mac.com> schrieb im Newsbeitrag
4AF46D24-7130-11D7-B5BC-0003934CA606@mac.com">news:4AF46D24-7130-11D7-B5BC-0003934CA606@mac.com...
> I'm trying to figure out how to use the $_get command on a string and
> keep the %'s around the value. Stripslashes removes some of the value.
> Example below.
>
> $test = "%2003%";
>   Want to use it like this>  select * from db where test like '$test'.
>
> When I use stripslashes, I get " 03%".
> I'm trying to allow the user to check a date that contains whatever
> they wish to search on or a comments field similarly. Any value for
> $test that starts with an alphanumeric character works fine... ($test =
> "%t20003%") returns "%t2003%" after stripslashes is ran on the
> variable. I've searched the web, but have found no examples of how to
> get around this. Anyone ever had to work through this percent issue?
> :)
>    Gale L. Allen Jr
>    Macintosh Support Specialist
> 865/947-5740
>
>    "Remember, Love wins over all"
> (:



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux