ICEcoffee Posted October 17, 2008 Share Posted October 17, 2008 Hi, I am in the early stages of developing a web app in PHP/MySQL. It is predominantly procedural (with type of MVC approach)in coding style though I do have some classes included(). ATM, I have my navigation links going straight to a bare-bones file that sets up variables for that page, such as: $pageAuthLevel, $metaPageTitle, $metaPageContent, $metaPageKeywords. Also defined in this page is the include paths for the actual html content file, the pages controller and lastly the pages view. I know I could include all this data in a MySQL db table and the include files from within the controller. The advantage of doing it the way I have it currently, is that the links are already written in an SEO friendly manner eg: /about-this-site.php and saves me from having to learn and setup mod_rewite in an .htaccess file. The disadvantage is that I have an additional file for every 'content' file, but the filesize is small and disk space is cheap. My question is though, which method is more efficient in terms of performance, scalability and security? Quote Link to comment https://forums.phpfreaks.com/topic/128841-which-approach-is-more-effiecient-file-or-db-entry/ Share on other sites More sharing options...
Liquid Fire Posted October 17, 2008 Share Posted October 17, 2008 In almost every case i know DB(and Object Oreinted Programming) has better maintainability and scalability. Quote Link to comment https://forums.phpfreaks.com/topic/128841-which-approach-is-more-effiecient-file-or-db-entry/#findComment-667940 Share on other sites More sharing options...
xtopolis Posted October 18, 2008 Share Posted October 18, 2008 I would learn mod_rewrite. This has to do with maintainability. Having to to touch 100, 1000, or w/e php files to update something, even using a function to do it is a pain and error prone. It is a bad habit to rely on something "cheaper" that works when you could do it "right"[in this case a more easily managed method], the first time. It's up to you, but I've seen a fair amount of mod_rewrite tuts out there that I'm sure you could learn if it would help you out enough. Quote Link to comment https://forums.phpfreaks.com/topic/128841-which-approach-is-more-effiecient-file-or-db-entry/#findComment-668469 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.