Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing HTML in MySQL Question

Status
Not open for further replies.

milo3169

Programmer
May 2, 2007
42
I have a question that I would like to get some input on. I have a data table that has saved HTML code along with product information in a field. I was wondering if it would make any difference as far speed goes if I was to just save product info in the DB and use PHP to generate the HTML code when the page is called? Does having the HTML code stored in the DB have any affect on the amount of time it takes to display a page?
I hope that makes sense. Thank you in advance.
 
If its a lot of code it might, I mean having to get like 100's of Mega Bytes of HTML to display a single field value would likely slow down things a bit. Otherwise I don;t think there be any noticeable difference.

However, mixing layout code and data code is not a good idea.
Keeping it separate allows for changes in one without affecting the other.
If you need to change the layout or look of the site, you wouldn't want to have to go into the DB to alter fields that hold HTML.







----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks vacunita. It's not a whole lot of HTML code that is being saved, but I think I will take your advise and seperate the layout code from the data code. You make a good point about if I wanted to change the look of the site, than I wouldn't have to go into the DB to alter the fields. Thanks for the tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top