Re: function for preserving special characters? [message #186079 is a reply to message #186078] |
Fri, 13 June 2014 09:03 |
Tim Streater
Messages: 328 Registered: September 2010
Karma:
|
Senior Member |
|
|
In article <4s7xh8hg1pcy(dot)ov70m21znbte$(dot)dlg(at)40tude(dot)net>, richard
<noreply(at)example(dot)com> wrote:
> When attempting to transfer records from one table to another, certain
> records refuse to be.
> Such as those with words like "I'm".
> What's even more confusing is, "It's" won't work, but "Cathy's" is ok?
>
> I know there is a procedure in PHP for dealing with this.
> I just can't find it right now.
> Can anyone help on this?
You need to read up on your database and find how it deals with things
like single-quotes (') in strings that you want to update a column
with. Or rather, how it expects *you* to present the data.
For SQLite, I do this:
$x = str_replace ('\'', '\'\'', $xx);
--
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
|
|
|