Re: Dynamic Web Pages
| From: | Lars Olsson | Date: | Tue, 30 Jul 2002 18:42:00 +0000 |
| Subject: | Re: Dynamic Web Pages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110390@lists.php.net to get a copy of this message | ||
Hi!
Database queries and global variables are not related to each other. It usually just boils down to the following steps
1. Collect data that that's needed for the database query (via $_GET or $_POST)
2. Run the query against the database and store the results in some nice variables (arrays/strings depending on data)
3. Display the results within the page by printing the variables at appropiate places inside your template file (test.php).
Obviously the possibilities are endless, but if you want a starting point you could try the following link:
http://www.php.net/manual/en/ref.mysql.php (check under Examples)
Kindly
/lasso (lasso@lassoweb.nu)
Rolando Morales wrote:
I would like to have the same page (test.php) have different text in it depending on a database entry. which is easy enough. but I want it to be on the fly. example list would be created on the fly depending on databse entries. which ever entry was picked (lets say STLT) it would open up my template test.php and it would but the STLT info on the page. Is there a way to do this without turning on Global_Variables which come standard off in php4.2.2 I'm using apache 2.0.39, PHP4.2.2, FreeBSD4.6, Mysql3.23.51 My database entries would bedeparment page artical template----------------------------------------stlt 1 <body of page> test.php aps 1 <body of page> test.php srp 1 <body of page> test2.php main 1 <body of page> test.phpthe list would be created by a query that looks for all page 1 entries from there the main page would show up(default), but once you pick from the list it would show the database enteries for that department. |-------|------------------------------- |main | |STLT | STLT was picked show STLT "artical" database entry|aps | this is are STLT page |srp | | ||-------|------------------------------- |-------|------------------------------- |main ||stlt | APS was picked show APS "artical" database entry|APS | this is are APS page|srp | | ||-------|------------------------------- I assume that Gobal_Variables are off for a reason.Rolando