Re: Re: Replicating Double quotes

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

 



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' ])


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux