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 #170668 is a reply to message #170665] Sun, 14 November 2010 17:11 Go to previous messageGo to previous message
Peter is currently offline  Peter
Messages: 15
Registered: March 2003
Karma:
Junior Member
In article <1g20e6900nhpj7k9ko2gvl223tl6jhmmgk(at)mfesser(dot)de>,
netizen(at)gmx(dot)de says...
> .oO(Robert Hairgrove)
>
>> I suggest you convert the data to something like base64 format or URI
>> encoding before storing it in the database. That way, you avoid this
>> issue and perhaps a few others as well (i.e. any unforeseen implicit
>> conversions of binary data). Besides, you can store the data as a normal
>> VARCHAR or TEXT field.
>
> I would rather suggest to find the real reason for the problem and fix
> it. It's a bug in some part of the code, not in MySQL.
>

Well, I wouldn't exactly have called it a bug. It was a script that I
found on the internet and it's possible the original creator didn't have
it in mind to store the data in a mysql database. And as I didn't write
the script, who knows?

As to debugging the script, it uses some maths functions including ord
to convert the original data into the encrypted data. So, I'm not sure
how the function is supposed to know what the outcome of the encryption
is going to be before it knows what the input is?

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.

However, how would I then know, when decrypting back that the different
char wasn't created as part of the original encryption or by my if
statement?

--
Pete Ives
Remove All_stRESS before sending me an email
[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: Tue Nov 26 18:58:17 GMT 2024

Total time taken to generate the page: 0.09921 seconds