|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Feb 2003
Location: Berlin
Posts: 315
|
Unable to insert base64_decode data in mySQL
Hi,
I am having a very strange problem: I have a field in my db where I store to content of emails base64_encoded. When I read this table and decode the content I can echo it "human readable", but if I try to update the table with exact the same content it stays encoded... The second strange thing is, that this applies to around 80% of the rows, but not all. Here is the code: PHP Code:
Notice: When echoing $new_content everything is decoded! I really don't have a clue what's going on. Please help! Regards Florian |
|
|
|
|
|
#2 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 464
|
ever heard of mysql_real_escape_string()?
|
|
|
|
|
|
#3 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Feb 2003
Location: Berlin
Posts: 315
|
apparently not...
![]() Thanx for that tip! |
|
|
|
|
|
#4 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 464
|
must be used every time you place data into query.
wonder, how lived without id before |
|
|
|
|
|
#5 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2002
Location: Australia
Posts: 2,092
|
To be clear Floezen, you should be escaping data used in a query whenever it may have come from a user (GET, POST, COOKIE), or another external source, or even your own data if it could contain funky characters.
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 20:22.










Linear Mode
