Jump to content


Photo

Exporting files


  • Please log in to reply
2 replies to this topic

#1 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 28 March 2006 - 06:05 PM

Yo,

Well, this time, something new (to me)..

I was reading a file to export it to db, and the file have a textarea with some \n, \t, \n\t, \t\n, (...).
I want to write it in a blob in the db.. but.. its export wrong..

I've tried to use ltrim, rtrim, trim, but its only remove left and right .. not int the middle..

So, i've seen the preg_replace in the documentation, but ive never saw it before..

Someone help me?

Thanks

D.Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 28 March 2006 - 06:10 PM

you mention textarea, so i can only assume it's text you want to store in the DB. the TEXT type, as opposed to BLOB, is more than capable of storing lots of text, even as far as an entire text file.

cheers
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 28 March 2006 - 06:20 PM

I think I don't told that clear.. (mine bad english x] )

I have one DB in the server X, I have to read the data and write into the DB at server H.

So, I export it to a [data.txt] file, because I need to rewrite some data and turn it compatible with the new DB.

The "textarea" i've been said is just a BLOB in the old DB, but when i write it in the file, this write with that \n and \t characters.

I export the file, read and replace the adaptations, and import to new DB, in theory.

This old-blob give me a headshake with itself string.. I need to replace the \n for new lines to write and lost the \t (tabs), so I can write it into the new-blob..

Clean now? sorry for bad sentences.. ^^"!

D.Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users