PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have found my site is beginning to get too big, too many files, becomes confusing when using login forums due to the structure of links and location of files.
I am planning to put all the page contents in the mysql db and just pull it out using variables like in index.php?page=...
I want to know is this safe to do, how would its speed compare to using the flat files? what type of column should I use? Blob, longtext ... or...?
and can i just dump the whole php file into a db field and not need to edit it?
complete pages/scripts in the database... I don't like that very much.
http://www.php.net/manual/en/configurat ... epend-file may help to prevent you from forgetting the login part (can be done in .htaccess for certain directories if you like).
You might also put all files in a .htaccess protected directory with allow None permission and have an index.php that dispatches all requests (include will still work)
If you get a lot of hits, pulling information from your mysql db every time someone wants to access a page will be a bit straining and resource intensive.
I suggest you just run through your files, find a better way to organize them (use sensible directories and filenames) and re-do the links. It'll probably take less than or as much time as it would to enter all these articles in the database, and it will save you some loading time as well.
I had the same dilemma, I ended up picking to use .inc/.php files rather than mysql db with contents because like Jim said, it slowed my server down considerably when it got busy.
Jim wrote:If you get a lot of hits, pulling information from your mysql db every time someone wants to access a page will be a bit straining and resource intensive.
I suggest you just run through your files, find a better way to organize them (use sensible directories and filenames) and re-do the links. It'll probably take less than or as much time as it would to enter all these articles in the database, and it will save you some loading time as well.
Just to elaborate on this abit further, i think its either 7 or 17 simultaneous(sp?) page views before a mysql DB starts to get a workload.