Re: store backslash in mysql database [message #170734 is a reply to message #170733] |
Wed, 17 November 2010 16:29 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 11/17/2010 6:53 AM, Luuk wrote:
> On 17-11-10 12:28, Jerry Stuckle wrote:
>> There is NO indication that the encryption routine was written in PHP or
>> some other language; if it was another language, there can be other
>> problems which mysql_real_escape_string() cannot fix - because it is
>> depending on the string being created correctly in PHP.
>
> Can you explain to us the difference between:
> 1) A string (http://en.wikipedia.org/wiki/String_(computer_science))
> and
> 2) A string created by PHP
>
> I'm really interested in the differences between both,
> because, to my knowledge, there is no difference.
> And i hope my knowledge about this is correct.
>
Luuk, the problem comes in when a string is created outside of PHP but
not according to the "rules". For instance, if the string contains the
character sequence "\n" and is placed in a PHP string incorrectly (as
can happen with extensions), the string may be interpreted as the two
character sequence (correct), or it may be interpreted as a newline
character - IOW, it could be interpreted as either "\n" or '\n'.
The solution here is to correct the code such that it inserts the
sequence correctly. And no, this is not theoretical - I had to
troubleshoot this very problem in an extension a while back - it wasn't
easy to find, mainly because we didn't at first suspect this was the
problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|