You are here: Re: 1 - 2 millions files in one folder? « PHP Programming Language « IT news, forums, messages
Re: 1 - 2 millions files in one folder?

Posted by Erwin Moller on 07/27/06 11:57

b007uk@gmail.com wrote:

> You are right :(
> Thats probably why i can't even enter that folder now, it takes ages :(
> I'll try to change it to work with mysql...
> To tell you the truth i am a bit affraid of mysql, was always storing
> data in folders/files, but i think i'll manage...
> And no, i can't predict the file names, so cant organize it, files are
> generated from the user input.

In that case make sure you put an index on the filename in your table.
It will speed up the lookups a lot, but it will decrease the
inserts/updates.

So if your system is most of the time busy looking up: use an index.
In case you are almost all the time inserting, leave it.

That is just a very general rule-of-thumb.
If you really want to know what is going on, use a profiler.
But forget about the profiler for now, and start learning SQL. :-)
(If you want to use mySQL, nothing wrong with that. I was just making a
punch to mySQL. It can probably easy do what you want. So just go mySQL.)

> Is it possible to store complete html files with all its tags in mysql?

Yes, no problem.
For a column of type TEXT or VARCHAR, the HTML is just a bunch of
characters.
Pay attention however to escaping.
SQL uses the ' as stringdelimitter, so if you use that ' in your HTML, be
sure you escape it. mySQL has all kinds of escapingfunctions, as does PHP
(addslashes()), so you'll find one that suits your needs.

Regards,
Erwin Moller

> Thank you very much!

 

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

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