FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » store backslash in mysql database
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: store backslash in mysql database [message #170734 is a reply to message #170733] Wed, 17 November 2010 16:29 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  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
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: website url as input how to create and save image on server in php?
Next Topic: Cannot write utf8 data into a utf8 column
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 11:17:07 GMT 2024

Total time taken to generate the page: 0.07250 seconds