Re: database-to-site structure advice?
| From: | Richard Lynch | Date: | Sun, 17 Dec 2000 06:43:59 +0000 |
| Subject: | Re: database-to-site structure advice? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30718@lists.php.net to get a copy of this message | ||
Add an ID field to your row, and just pass the ID from index.php to page.php
and fetch the full data.
----- Original Message -----
From: andrew <andrew@salamander.net>
Newsgroups: php.general
Sent: Saturday, December 16, 2000 9:50 PM
Subject: [PHP] database-to-site structure advice?
> Hi Gurus, wonder if someone can suggest an approach here:
>
> I have put content into a MySQL table, basically with a row per page, eg:
>
> row field : example field data
> ---------- ----------------------------------------------------------
> pagename : (page.php)
> title : (welcome to this page header text)
> textblurb : (this page is about bla bla bla and you care because...)
> picture : (img src ="/path/to/filesystem/img.jpg")
> link : (a href="link/to/related/page2.php")
>
> I want to have my main index.php page get a list of pages in the database,
> and present them as navigation items (doesn't seem too hard, via looping a
> select and echo).
>
> It also seems pretty straigforward to create a new page through a "select
> variables into array where pagename = page.php" statement that populates
an
> array of variables that are used to build a new page via a template.
>
> The thing I cannot wrap my head around is how do I jump from the index.php
> to page.php, e.g. page.php can contain a template, that is just looking
for
> said array, but I'm not sure how to pass that across or call the specific
> page.php variables and the template...?
>
> Any (breif) example would be greatly appreciated, or a pointer to some
> existing code that is doing this. This must be a fairly standard way of
> creating pages dynamically - anyone?
>
> As you can prob. tell, I'm good at databases and html, but not sure how to
> essentially make 'relational pages' that don't can persist as tables
instead
> of filesystem pages.
>
> Thanks in advance!
>
> regards,
> andrew
>
>
>
> ------ End of Forwarded Message
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>