Jump to content

storing data in php or xml files?


etrader

Recommended Posts

I want to store a series of data which are called in a main php file. Do you suggest to store them in xml as

 

file1.xml:

<title>TITLE</title>

<content>CONTENT</content>

 

or

file1.php:

$title="TITLE";

$content="CONTENT";

 

 

AND is it better to create separate file for each article or storing all data in one single file?

Link to comment
Share on other sites

if you store it all in a database, you can parse it as xml if required or push it to php variables, getting the best of both.

as for storing in seperate files, I wouldn't do that personally, but I don't think theres a huge amount of difference other than creating a method for file naming so you can keep track of all the files.

with a database you can have better control of your data also, such as filtering and ordering, which is all built into databases. file systems do have functionalitys like that but it refers to the date a file was changed, not say when the article was written.

 

Link to comment
Share on other sites

Thanks spiderwell,

 

I hope to avoid mysql database, as the system is simple and I prefer not to get involved with slow queries.

 

Regarding one single file, I was thinking of problem associated with large file; as in the case of separate file, only a small file is read for each query.

Link to comment
Share on other sites

Thanks spiderwell,

 

I hope to avoid mysql database, as the system is simple and I prefer not to get involved with slow queries.

 

Regarding one single file, I was thinking of problem associated with large file; as in the case of separate file, only a small file is read for each query.

if the system is simple, how are the queries slow?

in regards to files i guess its down to personal preference, but I think unless the site is going to have a LOT of traffic, like 1000's per hour, do you need to worry about performance that much?

just how big or busy is the site going to be? do you really need to worry about saving micro times (for want of a beter word)

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.

Guest
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.