Jump to content

Database text fields contain "rn" instead of blank lines


Recommended Posts

A customer of mine has a database that is now filled with "rn" characters all over the place. These characters exist where the fields in question used to have blank lines.


I'm assuming the customer did some sort of backup/restore or something. The problem isn't isolated to a single table or column; it is every text column in every table.


At this point it's all fixup, but I'm wondering how this happened. The customer "has no idea" but I think they are afraid to admit the problem was self-inflicted.


But out of my own curiosity, I'd like to know how this type of damage is even possible. Do you think there is some bad setting on the export or import that would have done this? Any other ideas how someone created this issue?

Link to comment
Share on other sites

::) What are you using to view the data?


More importantly why does your customer have access to do a "restore" that they don't know how to do correctly? If the customer is messing with data and doesn't know what they're doing, you're going to have even bigger issues in the future.


The fact that where you "used to" have blank lines (ie \r\n") and now claim to just have "rn"  - it's relevant that \r\n is a carriage return. Your post makes it sound like you have absolutely no idea about that.

Edited by Jessica
Link to comment
Share on other sites

I'm guessing that somewhere in the code somebody inserted a stripslashes() on data before it was inserted into the database. So, what would have been "\r\n" would now be "rn".


And, now that I think of it, maybe that stripslashes() was already there to workaround problems with having magic quotes turned on in the server. And, maybe that option has been turned off.

Link to comment
Share on other sites

I don't think magic_quotes was ever turned on because the customer is using HostGator and they generally have that ridiculous option turned off.


There's not a chance it's a stripslashes coding issue because there's no code that changes every TEXT column in the entire database; the fact that everything changed at once seems to lead me to some sort of export/restore thing.


Not sure what the guy did. I guess it is a mystery to us all.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.