View Full Version : Whats the best way to get this done?
jaywhy13
06-30-2005, 07:08 AM
Ok... I'm going to be building a site for this company right.. the site is basically news based. So from time to time... on a Very regular basis... articles will be written with pictures on it. There will lots and lots of pictures. So that dynamic content on the site will be mostly html content.
Question: Whats the best way store the html content? Do i use database's memos field to store the html markup? or do i use some directory structure algorithms or summin of the sort?
NancyJ
06-30-2005, 08:56 AM
HTML is just plain text, you can store it in any field that can hold text.
david7777
06-30-2005, 05:34 PM
Ok... I'm going to be building a site for this company right.. the site is basically news based. So from time to time... on a Very regular basis... articles will be written with pictures on it. There will lots and lots of pictures. So that dynamic content on the site will be mostly html content.
Question: Whats the best way store the html content? Do i use database's memos field to store the html markup? or do i use some directory structure algorithms or summin of the sort?
You shouldn't store any HTML though - just the article content along with image place holders and URL's... I am assuming all articles will have the same sort of layout? If so, you would store maybe the Article title, subtitle, body, date etc... Try to separate as much data as possible, so that you dont have one big messy clump of HTML to work with. This way, if the site look and feel changes, you wont have to go and edit all the database entries to look the same... Formatting should rarely be stored in a database.
jaywhy13
06-30-2005, 05:35 PM
HTML is just plain text, you can store it in any field that can hold text.
Am I correct to think that databases are storage procedure for EVERYTHING on the web? That using databases is the solution for my problem.
As for wot u said... the main thing I was thinking about is... don't problems arise when u attempt to store characters like... " and '.... say for example... <img src="blah.gif"> OR <img src='blah.gif'>... how do you work around that problem... Coz sql always gives u some error in that regard
david7777
06-30-2005, 05:49 PM
Am I correct to think that databases are storage procedure for EVERYTHING on the web? That using databases is the solution for my problem.
As for wot u said... the main thing I was thinking about is... don't problems arise when u attempt to store characters like... " and '.... say for example... <img src="blah.gif"> OR <img src='blah.gif'>... how do you work around that problem... Coz sql always gives u some error in that regard
Well with SQL, you just do a simple replace on the contents you want to put in the database, and replace all occurences of ' with ''... That problem is then solved.
Eg: insert the following text into SQL - "that's how you do things"
SQL code... INSERT...fields... VALUES(..., 'that''s how you do things', ...)
Just make sure to use sinlge quotes in you SQL syntax like above, then double quotes wont be a problem to insert. You just need to replace the single quote with two single quotes before inserting.
There are a few options of how to store data, and certain cases require certain storage mediums. Databases are used very widely when it comes to the internet, and is definately a solution to your problem, but it is NOT the only solution. You could store flat files, use RSS and XML etc. The downside with databases is performance - It is slower to get information out of a database, than it is to get from a file on the server. But it is harder to store files in an organised mannor on the server, so database will probably be easier...
jaywhy13
06-30-2005, 05:58 PM
OK... i read your post and also I read the others... and I gave it some thought.
The text part of the report could be easily separated from the images. i.e. i'll have the writers submit them separately. So basically.... for each report... its got a header, a writer, a date, a body, and some pics...
Wot do u think? Organized file manner? Database? Xml (i know a little bit of that)
david7777
06-30-2005, 06:10 PM
I think it would probably be easiest to use a database...
Sounds good. With the pics, i assume you would want them in certain parts of the article? If not, your method is fine, but otherwise you should somehow put a marker in the article body as to which picture should go where... You could have normal <img> tags with the url there, or you could create your own marker like [pic id=1] or something. Then when you get the information from the database to view it, your page would replace all occurences of [pic] with the corresponding image or something to that affect..?
I suggest you search around the net for same tutorials on creating "Article Websites" so that you can rather learn from other peoples mistakes, and get some nice ideas...
jaywhy13
06-30-2005, 06:39 PM
I think it would probably be easiest to use a database...
Sounds good. With the pics, i assume you would want them in certain parts of the article? If not, your method is fine, but otherwise you should somehow put a marker in the article body as to which picture should go where... You could have normal <img> tags with the url there, or you could create your own marker like [pic id=1] or something. Then when you get the information from the database to view it, your page would replace all occurences of [pic] with the corresponding image or something to that affect..?
I suggest you search around the net for same tutorials on creating "Article Websites" so that you can rather learn from other peoples mistakes, and get some nice ideas...
thanks
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.