Page 1 of 1

From databse generating a html page

Posted: Tue Feb 18, 2003 3:31 am
by lilly
Hello,

I have a question concerning generating a html page from a database.
Here is the idea:

I get on a web page were I can choose what I want on the next page.
Like: do I want a radio button or a choice list or a check box etc.
Then I can fill in the name of the "object" and all other info. This must be stored in a database and then be generated to a HTML page with prefixed fonts and so on.

Main question is. How can I define were those name and objects have to stand on the html page and how the page lay-out looks like. And can all this be stored in a database?

Does anyone have an example? If not, does anyone know how to do this?

Many thanks in advance.

A worried trainee

Posted: Tue Feb 18, 2003 7:11 am
by BDKR
Well, I didn't cast a vote, but the question looses a ton of points becuase it's not very clear. 8O

Work on that and you will be fine. :)

Now, as I'm unsure exactly what you're after, this may help a little. When you process information from a databae, it's normally returned as an array and termed a "row". That array has elements dependent upon what was retrieved. If you are getting first names and phone numbers, then maybe you would do something like this...

Code: Select all

while($row=your_db_fetch_array($resource))
   { 
   ?>
   <li>&nbsp;<?=$row['first_name']?>
   <li>&nbsp;<?=$row['phone']?>
   <?php
   }
Can you see then how as a row is returned you are displaying it's elements in a page?
You could also pass that row to functions or objects and have them process the data for you.

Hope this helps. Check google for tutorials as well.

Cheers,
BDKR