Howdy_McGee Posted June 24, 2011 Share Posted June 24, 2011 Ok, I have a PHP website that uses include to add in the header and footer. What is the wisest most efficient way to add in the separate keywords, descriptions and individual page stylesheets? Via database MYSQL or via multidimensional arrays? Quote Link to comment https://forums.phpfreaks.com/topic/240340-dynamic-styles/ Share on other sites More sharing options...
gizmola Posted June 25, 2011 Share Posted June 25, 2011 It's entirely up to you. Either solution will work, and each has strengths and weaknesses. Quote Link to comment https://forums.phpfreaks.com/topic/240340-dynamic-styles/#findComment-1234540 Share on other sites More sharing options...
requinix Posted June 25, 2011 Share Posted June 25, 2011 each has strengths and weaknesses. In a nutshell: Databases: Pros: Easy to change values with a web frontend, other things can also get/set the data Cons: Adds overhead, requires code to interact with it PHP code: Pros: Fast, structure can change easily, very portable Cons: Have to know some PHP to edit it, can't be edited remotely (unless you like writing kludgy code) Quote Link to comment https://forums.phpfreaks.com/topic/240340-dynamic-styles/#findComment-1234543 Share on other sites More sharing options...
gizmola Posted June 25, 2011 Share Posted June 25, 2011 each has strengths and weaknesses. In a nutshell: Databases: Pros: Easy to change values with a web frontend, other things can also get/set the data Cons: Adds overhead, requires code to interact with it Agree with Requinix here. Books have been written about this. Usually with a db you are looking for flexibility and ease of addition through a UI. If this is highly static data as is most everything you describe you don't want to have to makeup db lookup calls all the time, but you can mitigate that with caching. See -- just about every cms. Quote Link to comment https://forums.phpfreaks.com/topic/240340-dynamic-styles/#findComment-1234549 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.