Re: store backslash in mysql database [message #170699 is a reply to message #170694] |
Mon, 15 November 2010 13:09 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 11/14/2010 11:09 PM, Magno wrote:
> On 11/15/2010 12:16 AM, Jerry Stuckle wrote:
>> On 11/14/2010 10:08 PM, Magno wrote:
>>> On 11/14/2010 08:18 PM, Peter wrote:
>>>> In article<MPG(dot)274a7c95e2d635f19896dc(at)news(dot)virginmedia(dot)com>,
>>>> pete(dot)ivesAll_stRESS(at)blueyonder(dot)co(dot)uk says...
>>>> > In article<4ce02cdd$0$19902$91cee783(at)newsreader03(dot)highway(dot)telekom(dot)at>,
>>>> > usenet(at)helmutchang(dot)at says...
>>>> >> Am 14.11.2010 18:11, schrieb Peter:
>>>> >>
>>>> >>
>>>> >> The bug is not in the part of the encryption script. It is in the
>>>> >> part,
>>>> >> where the encrypted data is stored to the database.
>>>> >>
>>>> >>> So, all I could potentially do, as I see it, is include an extra:
>>>> >>>
>>>> >>> if, char converted to backslash, then change to a different char.
>>>> >>
>>>> >> No! Haven't you read the other answers, concerning
>>>> >> <http://www.php.net/manual/en/function.mysql-real-escape-string.php>?
>>>> >>
>>>> >> There are some characters in strings and blobs, that have to be
>>>> >> escaped
>>>> >> when used in a (My)SQL query. And it's not only the backslash. This
>>>> >> function does it for you in the correct way! *But*: The escape
>>>> >> sequences
>>>> >> are *not* stored in the database. So when you fetch the value
>>>> >> again, it
>>>> >> is exactly as you want it.
>>>> >>
>>>> > Sorry, I got a little thrown of the scent here for
>>>> > mysql_real_escape_string when the disagreements started. I've now
>>>> > taken
>>>> > a look at the function and it does seem ideal for my purposes.
>>>> >
>>>> >
>>>>
>>>> Sorry to reply to my own post but...
>>>>
>>>> Having read right to the very end, when they say \n is replaced by '\n'
>>>> litteral, what do they mean? If that means the \n is replaced by a
>>>> completely different MySQL representation of \n, then is it still going
>>>> to work for me?
>>>>
>>>
>>> Just use that function and determine by yourself that it works... Don’t
>>> mind the comment by Jerry, he clearly has a confusion about
>>> control-characters in PHP.
>>
>> No, I'm not at all confused by control characters in PHP. But remember
>> those strings only apply if the they were BUILT IN PHP. Strings built in
>> another language may or may not work with PHP functions. And there is no
>> indication of the language used to encrypt the data.
>>
>> However, you don't seem to understand there can be a difference.
>
> OK, I think you should just read the documentation. Please stop
> misguiding the OP. You are just confusing him with your own lack of
> understanding of PHP Internals.
> The OP asks because he doesn’t know... if you don’t also please don’t
> come to spit out your confusion because it only leads to even more
> confusion for who asks.
> I know and have seen that you have an habit of adding off-topic
> information or confusing technical questions to topics to look
> knowledgeable.
> But please don’t do this now.
Oh, believe me - I understand the PHP internals - much more than you do.
You shouldn't be showing your ignorance so much.
And none of what I said was off-topic. But you don't have enough
intelligence to understand that.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|