[PHP-DB] Multiple paragraphs; The trick?
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! **
Re: [PHP-DB] parse-error MySQL - PhP @ win2000
Thanks very much for the assistence: The curly-bracket thing did it! Now I finally know the installation has been succesfull! I'll try to start programming less sloppy, and spare you from these silly errors! I'll notify you when the site is up and running. Future site location: www.hyperspectral.info J. ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** - Original Message - From: "Roel Mulder" <[EMAIL PROTECTED]> To: "Jelle Ferwerda" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, November 10, 2001 10:39 PM Subject: Re: [PHP-DB] parse-error MySQL - PhP @ win2000 > Dag Jelle, > Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou > het goed moeten gaan. > > Dus regel 24 wordt: print ($resultaat[0]); > > (Excuse me muttering Dutch between the two of us :) > > M.vr.gr. > Roel Mulder > > At 21:32 10-11-2001 +0100, you wrote: > >Hi all, > > > >I have recently installed an apache server, PhP4 and MySql on my win2000 > >machine (I know, I should be running linux; That will have to come with > >time). But now I am trying to learn PhP - MySQL. When running the script > >below I get the error message: > > > >Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 > > > > > >Is there anybody who knows what the problem might be? I think is in the > >result display part, considering how things run properly when I leave it > >out. Hopefully you ca get me going, since I do not know what I am doing wrong!! > > > >Thanks for the help, > > > >Jelle > > > > > > >$host="localhost"; > >$username=""; > >$password=""; > >$database="jelle_test"; > >$table="pet"; > > > > > >$db = mysql_connect($host) > > or die ("verbinding maken met de server is mislukt"); > >Echo "gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db"; > > > > @mysql_select_db($database, $db) > > or die ("Helaas geen verbinding kunnen maken met de database"); > > > >$sql_select = "Select * from pet"; > >$result = mysql_query($sql_select, $db); > >if($result) { > > echo "Selectie succesvol"; > > while ( $resultaat = mysql_fetch_row($result)) { > > printf($resultaat[0]); > >} > > > >mysql_close($db); > >?> > > > > > >-- > > > > > >** > >Ir. Jelle G. Ferwerda > >[EMAIL PROTECTED] - www.bio-vision.nl > > Mulder Technisch Advies > Postbus 69 > NL-2740 AB WADDINXVEEN > tel. 0182-640184 fax. 0182-640185 > http://www.mta.nl > > > -- > 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 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] parse-error MySQL - PhP @ win2000
Hi all, I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle -- ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! **