You are here: Re: Suggestion needed on data storage format in text file « PHP Programming Language « IT news, forums, messages
Re: Suggestion needed on data storage format in text file

Posted by ImOk on 07/20/06 01:25

My suggestion is to use XML. PHP and Javascript has the Dom class that
supports this format very well. Its also easily extensible. And best of
all it's a text file.

Sample:

<mailbox name="some user">
<email>
<id>1234</id>
<subject>Send me the check<subject>
<to>nospam@nospam.com</to>
<from>someone@someone.com</from>
<message><![CDATA[blah blah blah blah blah
blah blah blah]]></message>
<attach>path to attach 1</attach>
<attach>path to attach 2</attach>
</email>
<email>
<id>5678</id>
<subject>Send me the check<subject>
<to>nospam@nospam.com</to>
<from>someone@someone.com</from>
<message><![cdata[blah blah blah ]]></message>
<attach>path to attach 1</attach>
<attach>path to attach 2</attach>
</email>
....etc...
</mailbox>
<mailbox name="some other user">
....
</mailbox>

Chung Leong wrote:
> Manish wrote:
> > The project I am developing doesn't involves database. I want to parse
> > the mailbox file (.mbx) and store the summary in the text file for fast
> > retrieval and display of information in the Inbox page.
> >
> > The sugegsted format are as:
> >
> > #1
> >
> > ID [4 bytes]: Subject [100 bytes]: To Address[100 bytes]: From
> > Address[100 bytes]...etc...
> >
> > #2
> >
> > Instead of preassining fixed size to variable (as actual data may be
> > much less or can grew to more), we can store the values continuously,
> > seperated by some unique seperator (#|#, *#*, ...)
> >
> > 1324#|#Hi, How are you#|#me@google.com#|#you@google.com#|# ... and so
> > on
> >
> >
> > Which of these will be the efficeint one (as there will be frequent
> > insert/delete/update of the individual information, eg. set message as
> > read ..., delete message ..., new message ...)
> >
> > Also please suggest on how to determine the variable size (100 bytes as
> > in #1), and assign the size to the variable accordingly and read it
> > (differentiate multiple variables) when required.
> >
> > Thanks.
> >
> > Manish
>
> That's the kind of project that SQLite was designed for. It's worth
> looking into.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация