# PHP - File handling/manipulation question

**URL:** https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388
**Category:** programming
**Created:** [November 1, 2003, 2:15pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388 "2003-11-01T14:15:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![APDesign](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@APDesign](https://forum.kirupa.com/u/APDesign)
#### Post date: [November 1, 2003, 2:15pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/1 "2003-11-01T14:15:29Z")

</div>

Alright, I plan on making a news updating program for my website so I can stop using [blogger.com](http://blogger.com) (even though it works really well if you tweak it out with a bunch of PHP.) It seems like it will be easy enough to do this myself, but I would also like to take a stab at doing the autoarchiving and stuff. One thing I was wondering is if I saved every news update as a seperate text file, would that be a lot slower than saving all the news updates into ONE text file (possibly 1 month/text file or something.) So in short - is it faster to save everything to one file than it would be to save stuff to different files. If you have any thoughts, just throw em out, I would appreciate it.

Thanks!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2003, 2:32pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/2 "2003-11-01T14:32:51Z")

</div>

it is probably faster to save everything to one file. This is because the majority of the overhead comes from opening/closing the file, not from reading the file, so if you stored info in multiple text files, you are maximising the overhead.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2003, 2:32pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/3 "2003-11-01T14:32:56Z")

</div>

I’d use mysql but without mysql I’d save them into one file… otherwize there’s gonna be a real bug bunch of txt files…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2003, 4:03pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/4 "2003-11-01T16:03:11Z")

</div>

alright cool, thanks for the info… yeah I would like to go with mysql too for functionality and ease, but I can only have 1 database, and I’m using it for my forum. Nice to know about the file opening/closing.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2003, 9:55pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/5 "2003-11-01T21:55:16Z")

</div>

you can run a whole website on one db, i have a forum, a guestbook, a poll, blogreader etc in mine…you can use as many TABLES as you like…?!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2003, 11:12pm UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/6 "2003-11-01T23:12:51Z")

</div>

Yeah what Eyez said. If mySQL is an option go with that. If not then just save everything in one text file.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 2, 2003, 2:59am UTC](https://forum.kirupa.com/t/php-file-handling-manipulation-question/34388/7 "2003-11-02T02:59:30Z")

</div>

hmm, I’ll have to look into eyez… I really have no mySQL knowledge, I set up a forum and had to create a database for that, and it sounded like I would only be able to use the database for the forum. my host is [www.1and1.com](http://www.1and1.com), I don’t know if you are familiar with them or not… I’m looking at the page right now and I think I understand what you are saying about having a databse and then different tables - and that makes a lot of sense. Sweet, now I can do it with mySQL! Thanks a lot, I never would have known!
