|
Posted by Andy Jeffries on 10/14/23 11:53
On Wed, 19 Jul 2006 21:07:06 -0700, Manish wrote:
> Hi Andy Jeffries, we are using PHP 5, so sprintf/fprintf can be used. I
> haven't come across using pointers in PHP. I will definitely try to learn
> it.
It's not pointers but string parsing (getting out a section of a string
and formatting a string to contain exact lengths of string).
> Hi ImOk, our initial datastructure was in the XML format itself,
> (individual XML file for every user). As there can be thousands of email,
> the file will grew larger and reading/writing may be slow/error prone. So
> it was suggested to use text file.
I don't wish to sound offensive, but if you can't correctly write to an
XML file without errors, why do you think you'll be able to do it to a
flat file using functions/methods you don't know?
Also, bear in mind if you use a database it will also handle locking from
multiple processes easily, which you will have to handle yourself in this
situation.
Don't think "we'll only have one user accessing their account through a
single web instance so we won't have concurrency issues" - people these
days may use browser tabs to work on their mail concurrently.
And you really do run the risk of data loss/corruption if you don't
correctly lock access to the file.
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|