when i read this value it gives 'i haven\'t attended'
If that's the case, then at the time of writing you inserted \'i haven\\\'t attended.\' to the database;
meaning it was still quoted twice. I assume that you either have another $dbh->quote() on that value somewhere in your code - or you are looking at old data in the database, not at the freshly inserted data.
Did you check if the new insert succeeded or maybe failed for some reason?
The data retrieved from the database (and not quoted after retrieving) should give i haven't attended - no backslashes.
Update:
in the database the value is stored as: i haven\
That data is corrupted. It was inserted as "i haven\\'" - the "'" survived and was interpreted as string terminator because it was oddly quoted: the quoting did not affect it, it only quoted the other backslash. That's strange, it looks like manual tampering to me. If that's not the case, I am at a loss here =(
Cheers, Sören
In reply to Re^3: escaping special characters in mysql queries
by Happy-the-monk
in thread escaping special characters in mysql queries
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |