Forum Moderators: coopster

Message Too Old, No Replies

includes or database?

         

jamie

8:51 am on Aug 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



we have pages which contain several paragraphs some of which have fotos.

is there an easy way to display that sort of data (pictures and text running down the page) from a database, or would it be easier to simply include() the info?

cheers

jatar_k

7:47 pm on Aug 20, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



both are fairly simple it really depends on the situation. If you are using some type of templating system and have many pages of content then ultimately the management will be easier with db. If it isn't on many pages then you may want to include the static text and manage it as such.

Depends on what you need, both methods are fairly staright forward.

db
more initial setup, less ongoing management time

static content with includes
quick to setup, more management time

jamie

7:56 am on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks jatar_k

regarding database logic...

how would i display a page of paragraphs and appropriate pictures? would each paragraph and appropriate picture have its own field in the DB, and i would access each one individually, or would i save the whole of the content in one field, e.g.

<p>some text
<img src="some.jpg"></p>
<p>some more text
<img src="some.jpg"></p>
<p>even more text
<img src="some.jpg"></p>

etc?

many thanks

jatar_k

4:02 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the key to designing anything is to understand the data and recognize the patterns in it and how it corelates with your other data.

That said, do you always have 3 or less paragraphs and 3 or less images? Is there a standard format for every page in regards to the content?

For example, if you have 3 paragraphs and 3 images the majority of the time and no more ever then you may want 3 content columns and three columns for the paths to the images.

You could also store the whole thing in one big column called content too. There really isn't a standard, it can be done both ways. The most important thing is to make it easy to update and fast for serving the pages.

jamie

6:12 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



no we don't actually have a standard format, preferring to chop and change a bit for different subjects.

i have however just been playing with htmlarea, which would be ideal for non-tecchies to update content pulled from a database, so it would probably make more sense for me to put everything in one field.

i think i'm just gonna have to bite the bullet and go for it.

the more i get into php/mysql the more i find out that their really is TMTOWTDI - i do love that ananana.. whatsit ;-)

many thanks jatar_k!