Re: Re: Replicating Double quotes

From: Date: Thu, 25 Mar 2004 20:10:02 +0000
Subject: Re: Re: Replicating Double quotes
Groups: php.windows 
Request: Send a blank email to php-windows+get-23278@lists.php.net to get a copy of this message
Here it is. Its the one you took the piss out of comments. Hi all, > > I have a problem in that when I am retrieving data from MySQL that containes > double quotes, the double quotes gets repeat, and also the string that does > contain double quotes gets double quotes added to the begin and end of it For > example I get the following: > > "16"" Manikin" > > From what should be the following > > 16" Manikin > > Wh I inserted the data into the database I used the 'addslashes' function. > Even when I use the 'stripslashes' the output is still the same. > > Anyone have any clues? :-s Ok, here is the procedure in which I am inserting the data into the database... // Retrieve a line from a file $line = trim($file_contents[$i]); //explode the line into an array $arr = explode(",", $line); // and then add slashes to exploded data items $name = addslashes(trim($arr[1])); With the name variable I then use it inside a query string When retrieving the data from the database I use the following... stripslashes($rows[ 'name' ])

« previous php.windows (#23278) next »