|
Posted by Henrik Hansen on 05/18/06 11:51
"lawrence k" <lkrubner@geocities.com> writes:
> I'm a little weak on my basic I/O. Help me out please.
>
> Is it right to say that I can just open any file with file(), get it as
> a string, and then store in a MySql database, in, say, a MediumText
> field? I realize that MySql supports binary fields, but my current
> MySql schema does not have any binary fields, and I'm wondering if I
> can store the file without changing my current schema.
>
> Can I recreate the file later, if I wish, just be grabbing the string
> out of the database and writing it to disk? (on a Linux system)
AFAIK you need to use blob fields as your data is binary (or is it,
what kind of files do you want to open?), if you store
it in a normal text field it can be corrupted. But else you are right,
you just take the ourput from the field and put in a file or output to
the browser with a header infront.
--
Henrik Hansen
Navigation:
[Reply to this message]
|