From databse generating a html page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply

Level of question

Poll ended at Tue Feb 25, 2003 3:31 am

1. bad
1
100%
2. average
0
No votes
3. good
0
No votes
 
Total votes: 1

lilly
Forum Newbie
Posts: 1
Joined: Tue Feb 18, 2003 3:31 am

From databse generating a html page

Post 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
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post 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
Post Reply