Re: [PHP-DB] Multiple paragraphs; The trick?

2001-11-13 Thread Chris Hobbs

Assuming you're using text fields, just include paragraph breaks 
normally ("\n\n") within the field entry. If you're outputting with 
HTML, you'll definitely need to replace those with  tags, but if 
you're simply e-mailing the contents plain text, or outputting in some 
other fashion, it should be straightforward to keep the the formatting 
intact.

Adding a separate table just for the paragraphs seems like more work 
than necessary, but would certainly work as well.

Jelle Ferwerda wrote:

> HI all,
> 
> Just a week or so ago I started testing PHP and MySQL databases. Testing is over. I 
>have figured out the basic controls etc. and it is time for the construction of the 
>database and the PhP scripts to get the site up and running. The general layout of 
>the database and its tables is more or less clear to me, except for one important 
>point, for which I would like some advise..
> 
> How do you generate multiple paragraphs as output, if they do not have specific 
>characteristics. 
> Say: I am building a database about a sensor, and this page covers like 2 pages of 
>A4 text. Obviously I'd like to make more then one paragraph and add some 
>layout&imagery between paragraphs. How do you put it in a database? (Say: Like this 
>message: The sender is me, the subject is multiple paragraphs, so you should be able 
>to select the message. How do you get the formatting in different paragraphs, since 
>it is not with a specific title, intro paragraph, main text and footer text). Any 
>number of paragraphs and images is possible, so I cannot just create a field for each 
>paragraph. 
> 
> Do you put all text as one entry in one field, with HTML to format the paragraphs? I 
>think it would work, but it doens't seem like it is THE solution..
> 
> Or should I add a table in which you put the paragraphs, which you select through 
>your main database, and then sort by paragraph number?
> 
> Like:
> 
> Table sensors
> [Sensor][compagny][country]..[sensor_ID]
> 
> Table Contents
> [Sensor_No][Para_No][Content]
> 
> The answer is probably obvious to you, but for a newbie like me... My 
>database-design book is unfortunatey not made for building databases for the web, and 
>do not explain this sort of structures. Unfortunately: SQL queries fail miserably in 
>my brain.. Probably need a mental upgrade here..
> 
> Hope you can help!
> 
> Thanks,
> 
> Jelle.
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Multiple paragraphs; The trick?

2001-11-12 Thread Jelle Ferwerda


HI all,

Just a week or so ago I started testing PHP and MySQL databases. Testing is over. I 
have figured out the basic controls etc. and it is time for the construction of the 
database and the PhP scripts to get the site up and running. The general layout of the 
database and its tables is more or less clear to me, except for one important point, 
for which I would like some advise..

How do you generate multiple paragraphs as output, if they do not have specific 
characteristics. 
Say: I am building a database about a sensor, and this page covers like 2 pages of A4 
text. Obviously I'd like to make more then one paragraph and add some layout&imagery 
between paragraphs. How do you put it in a database? (Say: Like this message: The 
sender is me, the subject is multiple paragraphs, so you should be able to select the 
message. How do you get the formatting in different paragraphs, since it is not with a 
specific title, intro paragraph, main text and footer text). Any number of paragraphs 
and images is possible, so I cannot just create a field for each paragraph. 

Do you put all text as one entry in one field, with HTML to format the paragraphs? I 
think it would work, but it doens't seem like it is THE solution..

Or should I add a table in which you put the paragraphs, which you select through your 
main database, and then sort by paragraph number?

Like:

Table sensors
[Sensor][compagny][country]..[sensor_ID]

Table Contents
[Sensor_No][Para_No][Content]

The answer is probably obvious to you, but for a newbie like me... My database-design 
book is unfortunatey not made for building databases for the web, and do not explain 
this sort of structures. Unfortunately: SQL queries fail miserably in my brain.. 
Probably need a mental upgrade here..

Hope you can help!

Thanks,

Jelle.


-- 


**
Ir. Jelle G. Ferwerda
**
Mankind:
Intelligent enough to make a strong impact on the environment,
But not strong enough to make an intelligent one!
**