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

From: Date: Fri, 18 Apr 2003 11:03:31 +0000
Subject: Re: Mysql like and stripslashes strangness... Help :)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-27160@lists.php.net to get a copy of this message
On Friday 18 April 2003 07:57, Allens wrote: > 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? For what you're doing there is no need for stripslashes(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ /* Jupiter is aligned with Mars. */

« previous php.db (#27160) next »